Tomcat启动报错 Unrecognized option: –add-opens=java.base/java.lang=ALL-UNNAMED
•
Jave
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.net2asp.com/bd69321d54.html
