我的 Mac OS X 10.11 历险记:
JamVM
built withmake clean && CFLAGS="-m32" ./configure.
GNU 类路径
花了一点时间:
# 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
如果你现在make,编译失败
java_io_VMConsole.c:80:19: error: use of undeclared identifier 'IUCLC'。我最终得到了googling what that symbol is - 这是一个八进制的 01000,并将其添加到源代码中:
vim ./native/jni/java-io/java_io_VMConsole.c
# add this line in the beginning of the file: #define IUCLC 0001000
之后,./configure 不断抱怨您的 javac 不是 GCJ。它看起来像 GNU Classpath 的一个老错误,我发现提到了类似的问题。正如您在下面看到的,./configure 已损坏,无法与除gcj 之外的任何javac 一起使用。
我最后只是编辑./configure:
- 一开始我加了一行
export JAVAC=$(which javac)
- 我将条件赋值替换为
JAVAC_IS_GCJ=no
现在,./configure 应该通过,但 make 不会。
我对@987654339@ 为-fsource= 生成的所有Makefiles 进行了grep,然后如果有带有-source 参数的备用行,则要么用-fsource 注释掉行(这是一个gcj 特定的标志),或者只是将fsource 替换为source。
最后一步,我必须编辑顶级 Makefile 并从 SUBDIRS = ... 行中删除 $(EXAMPLESDIR) - 它没有编译错误:
./gnu/classpath/examples/CORBA/NamingService/Demo.java:99: error:
package gnu.classpath.tools.tnameserv does not exist
gnu.classpath.tools.tnameserv.Main.main(args);"
它建成了!
我运行它时出错,但是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
(如果我设法运行它,我会更新答案)