Tomcat项目启动报错
JAVA_HOME、CATALINA_HOME都配置了,程序也没报错,但是在IDEA中启动Tomcat时报错
[2023-12-21 01:12:05,783] Artifact xx: Waiting for server connection to start artifact deployment...
Using CATALINA_BASE: "C:\Users\xx\AppData\Local\JetBrains\IntelliJIdea2024.2\tomcat\6c6606d6-a6d6-606b-660a-dce6a6cb600e"
Using CATALINA_HOME: "C:\My Program\Program\Tomcat\apache-tomcat-10.1.11"
Using CATALINA_TMPDIR: "C:\My Program\Program\Tomcat\apache-tomcat-10.1.11\temp"
Using JRE_HOME: "C:\My Program\Program\Java\jdk8u392-b08\jre"
Using CLASSPATH: "C:\My Program\Program\Tomcat\apache-tomcat-10.1.11\bin\bootstrap.jar;C:\My Program\Program\Tomcat\apache-tomcat-10.1.11\bin\tomcat-juli.jar"
Using CATALINA_OPTS: ""
Unrecognized option: --add-opens=java.base/java.lang=ALL-UNNAMED
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Disconnected from server
原因是Java版本和Tomcat版本不匹配,例如Java 8改为使用Tomcat 9就可以了文章来源:https://www.toymoban.com/news/detail-786460.html
也可能是其他环境的版本问题,切换试一下可能就好了文章来源地址https://www.toymoban.com/news/detail-786460.html
到了这里,关于Tomcat启动报错 Unrecognized option: --add-opens=java.base/java.lang=ALL-UNNAMED的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!