Index: Makefile =================================================================== --- Makefile (revision 508827) +++ Makefile (working copy) @@ -28,7 +28,8 @@ WWWGRP=${WWWGRP} SUB_LIST= TOMCAT_HOME=${TOMCAT_HOME} \ TOMCAT_USER=${WWWOWN} \ - JAVA_HOME=${JAVA_HOME} + JAVA_HOME=${JAVA_HOME} \ + JAVA_VERSION=${JAVA_PORT_VERSION} OPTIONS_DEFINE= HOST_MANAGER MANAGER DOCS EXAMPLES ROOT OPTIONS_DEFAULT= HOST_MANAGER MANAGER ROOT Index: files/tomcat9.in =================================================================== --- files/tomcat9.in (revision 508827) +++ files/tomcat9.in (working copy) @@ -44,7 +44,7 @@ # # tomcat9_logging_config (str): # Set to "${catalina.base}/conf/logging.properties" by default. -# Set the JUL config file +# Set the JUL config file # # tomcat9_java_home (str): # Set to "%%JAVA_HOME%%" by default. @@ -111,6 +111,17 @@ extra_commands="reload" +_tomcat_java_version=`${_tomcat_java_home}/bin/java -version 2>&1 | head -1 | sed -e 's/[^"][^"]*\"\([^\"]*\)\".*/\1/'` +case "${_tomcat_java_version:-%%JAVA_VERSION%%}" in + 9* | 1[0-9]* ) + _tomcat_endorsed_dirs_option= + ;; + *) + _tomcat_endorsed_dirs_option="-Djava.endorsed.dirs='${_tomcat_catalina_home}/endorsed'" + ;; +esac + + command="%%LOCALBASE%%/bin/jsvc" command_args="-java-home '${_tomcat_java_home}' \ -server \ @@ -124,7 +135,7 @@ -Djava.util.logging.manager=${_tomcat_logging_manager} \ -Djava.util.logging.config.file='${_tomcat_logging_config}' \ ${_tomcat_java_opts} \ - -Djava.endorsed.dirs='${_tomcat_catalina_home}/endorsed' \ + ${_tomcat_endorsed_dirs_option} \ -Dcatalina.home='${_tomcat_catalina_home}' \ -Dcatalina.base='${_tomcat_catalina_base}' \ -Djava.io.tmpdir='${_tomcat_catalina_tmpdir}' \