Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

removing java.endorsed.dirs from Tomcat on Eclipse with Java 9 and Java 10

I'm using Eclipse 4.7.3a with Tomcat 9.0.4 in the IDE. I upgraded from Java 8 to Java 10. I changed my JAVA_HOME to point to the JDK 10 installation. I went into Eclipse and created a new JDK installed JRE pointing at the Java 10 JDK, and selected it. I rebuilt my project, and tried to start the Tomcat server I had. It said:

-Djava.endorsed.dirs=C:\bin\tomcat\endorsed is not supported. Endorsed standards and standalone APIs
in modular form will be supported via the concept of upgradeable modules.

I poked around and found that in the Tomcat launch configuration in Eclipse, under the Arguments tab, there are the following VM arguments:

-Dcatalina.base="I:\work\.metadata\.plugins\org.eclipse.wst.server.core\tmp1" -Dcatalina.home="C:\bin\tomcat" -Dwtp.deploy="I:\work\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps" -Djava.endorsed.dirs="C:\bin\tomcat\endorsed"

I removed the last part, -Djava.endorsed.dirs="C:\bin\tomcat\endorsed", and hit Apply, but the changes don't "stick"; when I come back to that dialog, the value is still there, and I still can't run Tomcat.

How can I removed the java.endorsed.dirs system property from the Eclipse Tomcat configuration?

Better yet, how can I avoid the problem altogether? Isn't Eclipse and Tomcat ready for Java 9+? Will a newer version of Tomcat 9 fix the problem? Should I remove and add back the Eclipse server? How can I get to the root of the problem?

like image 207
Garret Wilson Avatar asked Oct 17 '22 17:10

Garret Wilson


2 Answers

I also have this problem before and but after updating WTP plugin to the latest version (3.9.5) which is not included even in the latest Eclipse (Oxygen.3a) to solve the problem.

like image 110
Ken Chan Avatar answered Oct 20 '22 23:10

Ken Chan


For me this was still occurring even in the latest Eclipse IDE 2019-12R with eclipse web tools platform release 3.16 running AdoptOpenJDK jdk-11.0.5.10-hotspot.

I did as the OP, found -Djava.endorsed.dirs in the Arguments tab under the VM arguments for Tomcat. Get there by right clicking your project, select Run As -> Run Configurations... then, search for tomcat. In my case I clicked on 'Tomcat v9.0 Server at localhost', selected the Arguments tab and found the offending entry by scrolling down in the 'VM arguments' text box. I deleted the argument and it's referenced path. I restarted Eclipse and it seems to have stuck.

like image 21
robrides Avatar answered Oct 21 '22 00:10

robrides