My Mac OS X 10.11 adventures:
JamVM
built with make clean && CFLAGS="-m32" ./configure
.
GNU Classpath
took a bit more:
# If you already made an attempt
make clean
## If you don't --disable-tools. I didn't have antlr, so I downloaded it.
#curl -O http://www.antlr.org/download/antlr-4.5.1-complete.jar
./configure --disable-gtk-peer --disable-gconf-peer \
--disable-tools # for tools: --with-antlr-jar=antlr-4.5.1-complete.jar
If you make
now, compilation fails with
java_io_VMConsole.c:80:19: error: use of undeclared identifier 'IUCLC'
. I ended up googling what that symbol is - it's an octal 01000, and added it right to the source:
vim ./native/jni/java-io/java_io_VMConsole.c
# add this line in the beginning of the file: #define IUCLC 0001000
After that, ./configure keeps complaining about your javac
not being GCJ. It looks like an old bug of GNU Classpath, I've found mentions of similar problems. As you see below, ./configure
is broken and won't work with any javac
other than gcj
.
I ended up just editing ./configure
:
- in the beginning, I added a line
export JAVAC=$(which javac)
- I replaced conditional assignment with
JAVAC_IS_GCJ=no
Now, ./configure
should pass, but make
won't.
I grepped all the Makefiles
that ./configure
generated for -fsource=
, and then either commented out lines with -fsource
(it's a gcj-specific flag) if there was an alternate lines with -source
argument, or just replaced fsource
with source
.
Last step, I had to edit top-level Makefile
and delete $(EXAMPLESDIR)
from SUBDIRS = ...
line - it didn't compile with an error:
./gnu/classpath/examples/CORBA/NamingService/Demo.java:99: error:
package gnu.classpath.tools.tnameserv does not exist
gnu.classpath.tools.tnameserv.Main.main(args);"
It built!
I got errors running it, but that's a totally different story...
$ DYLD_FALLBACK_LIBRARY_PATH=/usr/local/classpath/lib/classpath \
/usr/local/jamvm/bin/jamvm -verbose:class -verbose:jni Test
...
Failed to open library /usr/local/classpath/lib/classpath/libjavanio:
dlopen(/usr/local/classpath/lib/classpath/libjavanio.so,
1): image not found]
...
Exception occurred while printing exception (java/lang/NoClassDefFoundError)...
Original exception was java/lang/UnsatisfiedLinkError
(I'll update the answer if I manage to run it)