This is the mail archive of the
java-discuss@sources.redhat.com
mailing list for the Java project.
Re: how to read jar file
- To: Ian Zhang <hhzhang at yahoo dot com>
- Subject: Re: how to read jar file
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Tue, 12 Dec 2000 14:45:14 +1300
- CC: java-discuss at sourceware dot cygnus dot com
- References: <20001212012409.24449.qmail@web10005.mail.yahoo.com>
Ian Zhang wrote:
> >From the document on the Red Hat web site, the gcj
> program can read a jar file. But I tried the gcj
> which come from Red Hat 7 and did not make it work.
> It seems to me that gcj can only read .java or .class
> files. Can anyone help me with this and tell me exact
> command format?
I think it only works for uncompressed jar files. If you try to
compile a compressed jar, you'll get a "Not a valid .class file" error
or just an empty object file and no error. For an uncompressed jar,
you should be able to run something like:
gcj --shared myjar.jar -o myjar.so
or
gcj myjar.jar --main=my.Main -o myapp
regards
[ bryce ]