Tomcat 7.0.73 doesn't work with java 9

后端 未结 8 584
难免孤独
难免孤独 2020-11-30 10:14

Unable to start tomcat based app with java 9 because of default \"java.endorsed.dirs\" option in catalina.sh.

-Djava.endorsed.dirs=/usr/local/share/tomcat/en         


        
相关标签:
8条回答
  • 2020-11-30 10:24

    You have to remove -

    "-Djava.endorsed.dirs="/home/ttlaptop/Downloads/apache-tomcat-7.0.105/endorsed"

    from run configurations, and then tomcat will start

    0 讨论(0)
  • 2020-11-30 10:34

    This symptom can come about if you have a Tomcat Runtime using a JRE earlier than Java 9 and create and run a server with that runtime. Then edit the Tomcat Runtime to use Java 9 and try to start the server. What happens is that a "-Djava.endorsed.dirs" argument gets added to the launch configuration when the server was run with the earlier JRE. When running the server after the switch to Java 9, the "-Djava.endorsed.dirs" argument is seen as a user added VM argument and kept, resulting in the error.

    The simplest way to fix is to recreate the server. You can also right click on the server in the servers view and select Open. In the window that opens, click the "Open launch configuration" link at the bottom of the General section. In the dialog that opens, switch to the Arguments tab and in the "VM arguments" section, edit out the "-Djava.endorsed.dirs" argument and click OK. You should be able to start the server now.

    0 讨论(0)
  • 2020-11-30 10:35

    The above issue was fixed with the later releases of Eclipse but Unfortunately, it appeared again with the release of Java 10. Here is my research : Initially, I installed Java 10 and Eclipse Oxygen 3 which gave me the same error you mentioned in your question. But, at the moment I installed Java 9 and pointed my Apache tomcat runtime server to it, the error was gone.

    0 讨论(0)
  • 2020-11-30 10:38

    In Run configurations -> Arguments -> VM arguments try removing

    -Djava.endorsed.dirs="C:\Program Files\Apache Software Foundation\Tomcat 8.5\endorsed"

    0 讨论(0)
  • 2020-11-30 10:39

    I can't be sure but ..

    Step 1 -- > it worked for me, I just remove servers from eclipse

    Step 2 --> restarted and add server again (tomcat 7) Tomcat v7.0 Server at localhost

    0 讨论(0)
  • 2020-11-30 10:42

    You'll have to hack the script bin/catalina.sh to get this to work.

    There are a bunch of lines like this in bin/catalina.sh:

      exec "$_RUNJDB" "$LOGGING_CONFIG" $LOGGING_MANAGER $JAVA_OPTS $CATALINA_OPTS \
        -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
        ...
    

    Just remove the second of those lines (the one with -Djava.endorsed.dirs) in each case and you should be back in business.

    I'm looking at improving those scripts so that -Djava.endorsed.dirs is not provided to the JVM when the value is empty (which should be the case if you are using Java 9).

    UPDATE 2017-11-06

    Looks like r1810284 should fix the endorsed.dirs problem. Expect this fix to be included in Tomcat 7.0.83 (or whatever the next 7.0.x version passes voting).

    UPDATE 2018-03-07

    The first official release of Apache tomcat 7.0.x that includes this fix is Apache Tomcat 7.0.84, voted stable on 2018-01-24.

    0 讨论(0)
提交回复
热议问题