Help using -I

Gareth Buxton galik@mutopia.net
Wed Aug 6 10:48:00 GMT 2003


> +
> +main:	bob/Main.java	bob/Bob.java
> +	javac bob/Bob.java
> +	jar cvf bob.jar bob/Bob.class
> +	gcj --main=bob.Main -I bob.jar -o $@ $<

I also had problems working out the -I switch. In your case because you
want to compile the jar the -I is not relevant and I think the jar file
should be the main argument to gcj.

gcj --main=bob.Main bob.jar

What I didn't realise about -I is that if you want to compile against
several libraries you have to specify -I for each one.

gcj -I./lib/LibOne.jar -I./lib/LibTwo.jar ...

I couldn't get this to work:

gcj -I./lib/LibOne.jar:./lib/LibTwo.jar ...

Now this is probably obvoius to someone coming from a gcc background but
I was coming from a java background so it took a while to figure :)




-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://gcc.gnu.org/pipermail/java/attachments/20030806/4d12a814/attachment.sig>


More information about the Java mailing list