首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >编译期间使用netbeans-8的Jruby "InvokerGenerator :不支持的major.minor版本“

编译期间使用netbeans-8的Jruby "InvokerGenerator :不支持的major.minor版本“
EN

Stack Overflow用户
提问于 2014-12-22 13:25:09
回答 1查看 919关注 0票数 0

我从github克隆JRuby源代码,并首先在控制台(使用JDK7)中使用mvn编译源代码。编译成功。

THen我将整个项目加载到netbeans(8.0)中,并尝试编译,但它抛出了"exec-maven-plugin:1.2.1:exec (调用程序生成器)@jruby-THen“的错误。

代码语言:javascript
复制
cd /opt/pro/jrubysrc/jruby/core; JAVA_HOME=/opt/pro/JDK/jdk1.7.0_40 /opt/pro/netbeans-8.0.2/java/maven/bin/mvn -Dfile.encoding=utf-8 clean install
Scanning for projects...

...       

--- exec-maven-plugin:1.2.1:exec (invoker-generator) @ jruby-core ---
Exception in thread "main" java.lang.UnsupportedClassVersionError: **org/jruby/anno/InvokerGenerator : Unsupported major.minor version 51.0**
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: org.jruby.anno.InvokerGenerator. Program will exit.
------------------------------------------------------------------------
Reactor Summary:

JRuby ............................................. SUCCESS [0.948s]
JRuby Core ........................................ FAILURE [1:31.125s]
JRuby Lib Setup ................................... SKIPPED
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 1:32.562s
Finished at: Mon Dec 22 01:08:01 AST 2014
Final Memory: 17M/254M
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (invoker-generator) on project jruby-core: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

After correcting the problems, you can resume the build with the command
  mvn <goals> -rf :jruby-core

JDK仍然是1.7。似乎某些InvokerGenerator是由其他非1.7javac编译的。然后我清理了ruby-core项目,甚至手动删除了目标目录(选择项目,然后右键单击=>选择clean & build)。错误是相同的。

EN

回答 1

Stack Overflow用户

发布于 2014-12-22 21:37:22

我修好了。

为代码执行的Java版本似乎与我为netbeans配置的java版本不同。在netbean>tools>Java平台上。只有一个Java配置(Java 7)。我再次确认这也适用于JRuby-core项目。但是,当我右键单击项目并进行构建时,它使用open- JDK -6来执行invoke-generator,这是我的Ubuntu系统中的默认JDK。

我认为netbeans应该为项目使用已配置的JDK (包括编译和执行),这可能是netbeans的bug。

解决方法是在启动netbeans之前将JAVA_HOME设置到正确的JDK主目录。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27596990

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档