【问题标题】:how to build GNU Classpath and JamVM如何构建 GNU Classpath 和 JamVM
【发布时间】:2009-04-14 14:05:32
【问题描述】:

我正在尝试构建 GNU Classpath 0.98 和 JamVM 1.5.2。
按照 JamVM 自述文件,我做了“配置”;制作;在 jamVM 上进行安装',它工作正常。

然后我将 jamvm 和 Sun javac 添加到路径中。
然后使用 GNU Classpath 我这样做了:

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

我收到了这个错误:

javac 失败(见 config.log)

config.log 上,我看到 javac 找不到 VMStackWalker(它是特定于 jamvm 的) 我将 jamvm 类添加到 CLASSPATH 中,然后出现此错误:

Java VM jamvm 失败(参见 config.log)

config.log 上,我看到 jamvm 找不到java.lang.Class

怎么了?!

【问题讨论】:

    标签: classpath gnu jamvm


    【解决方案1】:

    【讨论】:

    • 是的,因为这是解决问题的方法,没有其他人找到它。
    • 也就是说,这违反了 StackOverflow 上仅链接答案的规则:答案应该从它使用的任何链接后面复制足够的信息,即使该链接断开,它仍然保持有用。另请参阅stackoverflow.com/help/how-to-answer 中的“为链接提供上下文”部分
    • (确实,阅读那个帖子,我不知道提出了哪些答案,以及讨论中的哪个人解决了你的问题)跨度>
    【解决方案2】:

    为 Ubuntu12.04 编译 GNU Classpath 的步骤: https://groups.google.com/forum/#!topic/jruby-gsoc/-fnKnP7zxbI

    为 Ubuntu 12.04 编译 JamVM 的步骤: https://groups.google.com/forum/#!topic/jruby-gsoc/uJ6RlVvHR-0

    【讨论】:

      【解决方案3】:

      试试ecj,classpath需要java编译器,sun sdk这里好像不行

      【讨论】:

        【解决方案4】:

        我的 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 不会。

        我对@9​​87654339@ 为-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
        

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

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2013-10-05
          • 1970-01-01
          • 2022-08-16
          • 2017-01-01
          相关资源
          最近更新 更多