Tomcat 7.0.73 不适用于 Java 9 [英] Tomcat 7.0.73 doesn't work with java 9

查看:42
本文介绍了Tomcat 7.0.73 不适用于 Java 9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于 catalina.sh 中的默认java.endorsed.dirs"选项,无法使用 java 9 启动基于 tomcat 的应用程序.

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/endorsed is not supported. Endorsed standards and standalone APIs in modular form will be supported via the concept of upgradeable modules. 
Error: Could not create the Java Virtual Machine. 
Error: A fatal exception has occurred. Program will exit.

有没有办法解决这个问题?

Is there a work around for this?

推荐答案

你必须破解脚本 bin/catalina.sh 才能让它工作.

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

bin/catalina.sh中有一堆这样的行:

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

只需在每种情况下删除这些行中的第二行(带有 -Djava.endorsed.dirs 的那一行),您就应该恢复正常工作了.

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

我正在考虑改进这些脚本,以便在值为空时不向 JVM 提供 -Djava.endorsed.dirs(如果您使用的是 Java 9,情况应该如此).

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).

更新 2017-11-06

看起来 r1810284 应该修复 endorsed.dirs 问题.预计此修复将包含在 Tomcat 7.0.83(或下一个 7.0.x 版本通过投票的任何版本)中.

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).

更新 2018-03-07

包含此修复程序的 Apache tomcat 7.0.x 的第一个正式版本是 Apache Tomcat 7.0.84,于 2018 年 1 月 24 日投票为稳定版.

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.

这篇关于Tomcat 7.0.73 不适用于 Java 9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆