build probs w/libgcj: java-array.h not found
Joerg Brunsmann
joerg.brunsmann@FernUni-Hagen.de
Mon Nov 22 06:42:00 GMT 1999
David Brownell <mojojojo@pacbell.net> wrote:
> So I guess I'd say accurate build instructions should be found
> through the FAQ, as well as part of the distribution(s).
FWIW I sat down and documented the way I used to build gcj/libgcj:
http://www.informatik.fernuni-hagen.de/import/pi3/joerg/gcj/howto.html
or as simple text:
1. Get a GCC snapshots from
ftp://gcc.cygnus.com/pub/egcs/snapshots/index.html
They are made about once a week.
2. Get a Libgcj snapshots from
ftp://sourceware.cygnus.com/pub/java/snapshot
They are made nightly.
3. Make a compile directory
$ mkdir compile
4. Move the snapshots into the compile dir, e.g.
$ cd compile
$ mv ../egcs-19991110.tar.gz .
$ mv ../libgcj-snapshot-1999-11-12.tar.gz .
$ gunzip *.gz
$ tar xfv *.tar
$ ln -s egcs-19991102 egcs
$ ln -s libgcj-snapshot-1999-11-12 libgcj
5. Compile and install egcs/gcj
$ cd egcs
$ make objdir
$ cd objdir
$ ../configure --enable-threads=posix --prefix=/home/joerg/gcc \
--enable-java-gc=boehm --with-as=/opt/gnu/bin/as \
--with-ld=/opt/gnu/bin/ld
$ make bootstrap
$ make install
If you compile under Linux you could omit the last two options. Under
Solaris you'll need them. If you omit '--prefix' the compiled source will
be installed under /usr/local. For more information about installing
egcs and/or configuration options see:
http://egcs.cygnus.com/install/index.html
6. Set the Path to the newly installed gcc
$ setenv PATH /home/joerg/gcc/bin:$PATH
Be sure to use the path with you gave the configure script
with '--prefix'.
Test the existence with
$ gcj -v
7. Compile and install libgcj
$ cd ../libgcj
$ mdir objdir
$ cd objdir
$ ../configure --enable-threads=posix --prefix=/home/joerg/libgcj \
--enable-java-gc=boehm --with-as=/opt/gnu/bin/as --with-ld=/opt/gnu/bin/ld
Again, the last two options are needed for Solaris.
$ make
$ make install
Make sure you configured both gcj and libgjc with the same garbarge collector
and with the same thread package. If you use the default for gcj/egcs (no
configure option) you have to use --enable-java-gc=no for libgcj.
8. Adjust you environment
Edit a file env.csh:
setenv PATH /home/joerg/gcc/bin:$PATH
setenv LD_LIBRARY_PATH /home/joerg/libgcj/lib
setenv CLASSPATH /home/joerg/libgcj/share/libgcj.zip
$ source env.csh
9. Copy the libgcj.spec to you current directory
$ cp /home/joerg/libgcj/lib/libgcj.spec .
10. Edit a file HelloWorld.java
public class HelloWorld {
public static void main(String [] args) {
System.out.println("Hello");
}
}
11. Compile and run HelloWorld
$ gcj --main=HelloWorld -o HelloWorld HelloWorld.java
$ ./HelloWorld
More information about the Java
mailing list