Am 28.08.2017 um 21:00 schrieb Christopher Schultz:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Rainer,
On 8/28/17 12:45 PM, Rainer Jung wrote:
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.
Ah, thanks for finding that. I wasn't thinking about setclasspath.sh.
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.
So if [ -z "${JAVA_ENDORSED_DIRS}" -a -d "${CATALINA_HOME}/endorsed" ]
then we'll set JAVA_ENDORSED_DIRS. And if the value is empty when
launching Java, we'll leave it out?
Yes, that sounds right.
This would slightly improve compatibility with existing
installations if people would have created the default TC endorsed
dir and used it.
+1
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).
I'll have a look at these as well.
Thanks,
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org