Hi Chris,

Am 28.08.2017 um 16:10 schrieb Christopher Schultz:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

All,

According to this post[1] over at SO, Tomcat 7 doesn't work with Java
9 out of the box. This is because of the use of -Djava.endorsed.dirs,
which also appears in Tomcat 8. I suspect that feature is used in
prior versions of Tomcat startup scripts as well.

Tomcat's "Which Version" page claims that Tomcat X works with Java "Y
and later", which is not strictly true at this point because Tomcat's
startup scripts will cause Java 9 to fail[2] due to the removal of the
endorsed overrides mechanism.

I'm wondering if we should modify the startup scripts to stop
specifying -Djava.endorsed.dirs unless the environment variable
actually contains a value. The current catalina.sh in Tomcat 8
supplies this option unconditionally, therefore Java 9 will fail.

The only place I can see where JAVA_ENDORSED_DIRS is actually *set* in
catalina.sh is when the user is running cygwin, but that is only to
convert the path separator from \ to / for UNIX-style paths.

I think it gets set to "$CATALINA_HOME"/endorsed in setclasspath.sh if the user has not set JAVA_ENDORSED_DIRS herself.

I would slightly modify your plan for compatibility, namely setting it only if the user has provided JAVA_ENDORSED_DIRS *or* "$CATALINA_HOME"/endorsed exists. AFAIK we do not ship any Tomcat packaging that contains such a directory.

This would slightly improve compatibility with existing installations if people would have created the default TC endorsed dir and used it.

Any objections?

Tomcat 8.5/9.0 have removed the JAVA_ENDORSED_DIRS environment
variable from their scripts, so there should not be any problems,
there, of course.

In all version there is a mention of the endorsed system property in java/org/apache/jasper/compiler/AntCompiler.java, but the code looks like it only uses it if it was already set. That should be OK.

There's also a mention of it in webapps/docs/class-loader-howto.xml, tool-wrapper.sh and daemon.sh as well as the bat versions of the files and in res/tomcat.nsi (all for TC 7 and 8).

Regards,

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to