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

查看:89
本文介绍了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.

有解决方法吗?

推荐答案

您必须破解脚本 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-01-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天全站免登陆