English 中文(简体)
如何构建GNU Classpath和JamVM吗
原标题:
  • 时间:2009-04-14 14:05:32
  •  标签:

I m trying to build GNU Classpath 0.98 and JamVM 1.5.2.
Following the JamVM readme, I did configure; make; make install on the jamVM, and it worked.

I then added jamvm and Sun javac to the path.
Then with GNU Classpath I did this:

./configure --enable-jni --disable-gtk-peer --disable-gconf-peer --disable-plugin

我得到这个错误:

javac失败(见config.log)

On the config.log, I see that javac can t find VMStackWalker (which is jamvm-specific) I added the jamvm classes to the CLASSPATH, then 我得到这个错误:

Java VM jamvm失败(见config.log)

在<代码>配置。日志> < /代码,我看到jamvm无法找到<代码> . lang . class > < /代码。

什么错了? !

最佳回答

源泉!

< a href = " http://sourceforge.net/forum/message.php?msg_id = 7193290 " rel = " http://sourceforge.net/forum/message.php?msg_id=7193290 nofollow noreferrer " > < / >

问题回答

Steps to compiling GNU Classpath for Ubuntu12.04: https://groups.google.com/forum/#!topic/jruby-gsoc/-fnKnP7zxbI

Steps to compiling JamVM for Ubuntu 12.04: https://groups.google.com/forum/#!topic/jruby-gsoc/uJ6RlVvHR-0

尝试ecj,类路径中需要一个java编译器,和太阳sdk似乎没有好

我的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

(我更新答案如果我设法运行它)





相关问题
热门标签