简体   繁体   中英

Tomcat 9 not working with Java 10 on Ubuntu

I have downloaded Java 10 with this command:

sudo add-apt-repository ppa:linuxuprising/java
sudo apt-get update
sudo apt-get install oracle-java10-installer
sudo apt-get install oracle-java10-set-default

It is installed successfully since I can see the Java version through java -version

But when I change in tomcat.service file the

Environment=JAVA_HOME=/usr/lib/jvm/java-10-oracle/

I can't run anymore Tomcat. However, it works with Java 8 that has been installed through sudo apt-get install default-jdk command:

Environment=JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre

Ok. I suggest to go with Java 8 or 9. Even if Tomcat says that Tomcat 9 can support Java 8 and later version is better to go stable instead of the las JRE.

From Tomcat site :

Users were successfully running Tomcat 8 on Java 8 many months before the first stable Java 8 release. However, users of early access builds should be aware of the following:

It is not unusual for the initial early access builds to contain bugs that can cause problems for web applications running on Tomcat.

If the new Java version introduces new language features then the default JSP compiler may not support them immediately. Switching the JSP compiler to javac may enable these new language features to be used in JSPs.

If you do discover an problem using a Java early access build, please ask for help. The Tomcat user's mailing list is probably the best place to start.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM