console报错:"-Djava.endorsed.dirs=D:\apache-tomcat-9.0.7\endorsed is not supported. Endorsed standards and standalone APIs in modular form will be supported via the concept of upgradeable modul"的原因及解决办法

我使用eclipse创建了一个web项目,然后用Tomcat服务器run这个项目时发现它先是警告:“Error:Could not create the Java Virtual Machine.Errpr:A fatal exception has occurred.Program will exit.”

 

然后在console中报错:“-Djava.endorsed.dirs=D:\working\apache-tomcat-9.0.7\endorsed is not supported. Endorsed standards and standalone APIs

in modular form will be supported via the concept of upgradeable modules.”

 

原因:我当时使用的Java的jdk版本是10.0,而Tomcat版本是9.0.7。我试了好多方法不能解决,偶然看到可能是jdk版本和Tomcat版本不匹配的问题。

解决办法:我就试着使用9.0.4版本的jdk,仍然使用9.0.7版本的Tomcat。注意要把之前错误的server删掉,关闭eclipse,卸载10.0版本的jdk和jre,再启动eclipse,进行run as,一切正常。

Good luck!

posted @ 2018-04-16 15:20  霍尔莫  阅读(12390)  评论(0编辑  收藏  举报