微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

检测到的JDK版本:11.0.8不在允许的范围内[1.8.0-101,1.8.9999]

如何解决检测到的JDK版本:11.0.8不在允许的范围内[1.8.0-101,1.8.9999]

我正在尝试从源代码构建斐济软件。以下是github页面fiji source code 我首先从ubuntu的终端使用maven构建项目,然后遇到了这个错误

ali@ali-All-Series:~/Downloads/fiji-master$ 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,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] 
[INFO] ----------------------------< sc.fiji:fiji >----------------------------
[INFO] Building Fiji 2.1.2-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-rules) @ fiji ---
[INFO] Adding ignore: module-info
[INFO] Adding ignore: meta-inf/versions/*/module-info
[INFO] Adding ignore: com.esotericsoftware.kryo.*
[INFO] Adding ignore: com.esotericsoftware.minlog.*
[INFO] Adding ignore: com.esotericsoftware.reflectasm.*
[INFO] Adding ignore: com.google.inject.*
[INFO] Adding ignore: jnr.ffi.*
[INFO] Adding ignore: org.apache.hadoop.yarn.*.package-info
[INFO] Adding ignore: org.apache.spark.unused.UnusedStubClass
[INFO] Adding ignore: org.hibernate.stat.ConcurrentStatisticsImpl
[INFO] Adding ignore: org.jetbrains.kotlin.daemon.common.*
[INFO] Adding ignore: org.junit.runner.Runner
[INFO] Adding ignore: module-info
[INFO] Adding ignore: module-info
[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].
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  22.131 s
[INFO] Finished at: 2020-08-23T23:01:01+04:30
[INFO] ------------------------------------------------------------------------
[ERROR] 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. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors,re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions,please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
ali@ali-All-Series:~/Downloads/fiji-master$ 
我怎样才能解决这个问题?

解决方法

JAVA_HOME环境变量设置为Java 1.8目录。

示例:

JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
,

这并不完全针对您的情况,但可能会有所帮助。

例如,在 Eclipse 中,您可以转到 Preferences > Java > Installed JREs > Add the JDK 1.8 from Fiji's Java folder。这至少解决了 Eclipse 上的版本冲突。对于其他 IDE,您应该可以类似地更改路径。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?