英文:
Detected JDK Version: 11.0.8 is not in the allowed range [1.8.0-101,1.8.9999]
问题
我正在尝试从源代码构建 Fiji 软件。这是其 GitHub 页面:fiji 源代码。
我开始通过在 Ubuntu 终端中使用 Maven 构建项目,但遇到了以下错误:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
...
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-rules) @ fiji ---
...
[WARNING] Rule 2: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with message:
Detected JDK Version: 11.0.8 is not in the allowed range [1.8.0-101,1.8.9999].
...
[BUILD FAILURE] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (enforce-rules) on project fiji:
Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.
如何修复这个问题?
英文:
I'm trying to build fiji software from it's source code.here's the github page:fiji source code
I started with building project using maven from ubuntu's terminal and I faced with this error:
<html>
<pre><font color="#4E9A06"><b>ali@ali-All-Series</b></font>:<font color="#3465A4"><b>~/Downloads/fiji-master</b></font>$ mvn
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[<font color="#3465A4"><b>INFO</b></font>] Scanning for projects...
[<font color="#3465A4"><b>INFO</b></font>]
[<font color="#3465A4"><b>INFO</b></font>] <b>----------------------------< </b><font color="#06989A">sc.fiji:fiji</font><b> >----------------------------</b>
[<font color="#3465A4"><b>INFO</b></font>] <b>Building Fiji 2.1.2-SNAPSHOT</b>
[<font color="#3465A4"><b>INFO</b></font>] <b>--------------------------------[ jar ]---------------------------------</b>
[<font color="#3465A4"><b>INFO</b></font>]
[<font color="#3465A4"><b>INFO</b></font>] <b>--- </b><font color="#4E9A06">maven-enforcer-plugin:1.4.1:enforce</font> <b>(enforce-rules)</b> @ <font color="#06989A">fiji</font><b> ---</b>
[<font color="#3465A4"><b>INFO</b></font>] Adding ignore: module-info
[<font color="#3465A4"><b>INFO</b></font>] Adding ignore: META-INF/versions//module-info
[<font color="#3465A4"><b>INFO</b></font>] Adding ignore: com.esotericsoftware.kryo.
[<font color="#3465A4"><b>INFO</b></font>] Adding ignore: com.esotericsoftware.minlog.*
[<font color="#3465A4"><b>INFO</b></font>] Adding ignore: com.esotericsoftware.reflectasm.*
[<font color="#3465A4"><b>INFO</b></font>] Adding ignore: com.google.inject.*
[<font color="#3465A4"><b>INFO</b></font>] Adding ignore: jnr.ffi.*
[<font color="#3465A4"><b>INFO</b></font>] Adding ignore: org.apache.hadoop.yarn..package-info
[<font color="#3465A4"><b>INFO</b></font>] Adding ignore: org.apache.spark.unused.UnusedStubClass
[<font color="#3465A4"><b>INFO</b></font>] Adding ignore: org.hibernate.stat.ConcurrentStatisticsImpl
[<font color="#3465A4"><b>INFO</b></font>] Adding ignore: org.jetbrains.kotlin.daemon.common.
[<font color="#3465A4"><b>INFO</b></font>] Adding ignore: org.junit.runner.Runner
[<font color="#3465A4"><b>INFO</b></font>] Adding ignore: module-info
[<font color="#3465A4"><b>INFO</b></font>] Adding ignore: module-info
[<font color="#C4A000"><b>WARNING</b></font>] Rule 2: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with message:
Detected JDK Version: 11.0.8 is not in the allowed range [1.8.0-101,1.8.9999].
[<font color="#3465A4"><b>INFO</b></font>] <b>------------------------------------------------------------------------</b>
[<font color="#3465A4"><b>INFO</b></font>] <font color="#CC0000"><b>BUILD FAILURE</b></font>
[<font color="#3465A4"><b>INFO</b></font>] <b>------------------------------------------------------------------------</b>
[<font color="#3465A4"><b>INFO</b></font>] Total time: 22.131 s
[<font color="#3465A4"><b>INFO</b></font>] Finished at: 2020-08-23T23:01:01+04:30
[<font color="#3465A4"><b>INFO</b></font>] <b>------------------------------------------------------------------------</b>
[<font color="#CC0000"><b>ERROR</b></font>] Failed to execute goal <font color="#4E9A06">org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce</font> <b>(enforce-rules)</b> on project <font color="#06989A">fiji</font>: <font color="#CC0000"><b>Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed.</b></font> -> <b>[Help 1]</b>
[<font color="#CC0000"><b>ERROR</b></font>]
[<font color="#CC0000"><b>ERROR</b></font>] To see the full stack trace of the errors, re-run Maven with the <b>-e</b> switch.
[<font color="#CC0000"><b>ERROR</b></font>] Re-run Maven using the <b>-X</b> switch to enable full debug logging.
[<font color="#CC0000"><b>ERROR</b></font>]
[<font color="#CC0000"><b>ERROR</b></font>] For more information about the errors and possible solutions, please read the following articles:
[<font color="#CC0000"><b>ERROR</b></font>] <b>[Help 1]</b> http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
<font color="#4E9A06"><b>ali@ali-All-Series</b></font>:<font color="#3465A4"><b>~/Downloads/fiji-master</b></font>$
</pre>
</html>
how can i fix this?
答案1
得分: 4
将JAVA_HOME
环境变量设置为Java 1.8
目录。
示例:
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
英文:
Set JAVA_HOME
environment variable to Java 1.8
directory.
Example:
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
答案2
得分: 1
这并不完全适用于您的情况,尽管可能会有帮助。
例如,在Eclipse中,您可以转到“Preferences”(首选项)>“Java”(Java)>“Installed JREs”(已安装的JRE)>从Fiji的Java文件夹添加JDK 1.8。这至少可以解决Eclipse上的版本冲突。您应该能够类似地为其他集成开发环境更改路径。
英文:
This isn't quite specific to your situation, though it may be helpful.
For example, in Eclipse you can go to Preferences > Java > Installed JREs > Add the JDK 1.8 from Fiji's Java folder. This resolves version conflicts on Eclipse at least. You should be able to change the path similarly for other IDEs.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论