我的Mac OS X 10.11冒险:
JamVM
< a href = " https://stackoverflow.com/questions/9940503/building-jamvm-1-5-4-on-os-x-lion " >与< / > <代码>使清洁& & CFLAGS =“两个同伴m32”。/ configure > < /代码。
GNU Classpath
花了一点:
# 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
之后,. / configure一直抱怨你的<代码> javac > < /代码不是GCJ。它看起来像一个老虫GNU Classpath,我发现提到的同样的问题。如你所见,<代码>。/配置> < /代码是破碎的,不会与任何<代码> javac除了<代码> < /代码> gcj > < /代码。
我最终只是编辑<代码>。/ configure > < /代码:
- in the beginning, I added a line
export JAVAC=$(which javac)
- I replaced conditional assignment with
JAVAC_IS_GCJ=no
现在,<代码>。/ > < /代码应该通过配置,但<代码> < /代码>不会。
我grep <代码> makefile < /代码>,<代码>。/配置< /代码>为<代码>生成-fsource = > < /代码,然后注释掉了线与<代码> -fsource > < /代码(它年代gcj-specific国旗)如果有备用线路<代码>源> < /代码参数,或者只是替换<代码> fsource < /代码>与<代码> < /代码>来源。
最后一步,我不得不编辑顶级Makefile < /代码>和<代码>删除<代码>美元(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);"
It built!
我得到错误运行它,但< a href = " https://stackoverflow.com/questions/19776571/error-dlopen-library-not-loaded-reason-image-not-found " >,年代一个完全不同的故事< / >…
$ 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
(我更新答案如果我设法运行它)