简体   繁体   English

Tomcat 9无法在Ubuntu上使用Java 10

[英]Tomcat 9 not working with Java 10 on Ubuntu

I have downloaded Java 10 with this command: 我已经使用以下命令下载了Java 10:

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 因为我可以通过java -version看到Java版本,所以安装成功

But when I change in tomcat.service file the 但是当我在tomcat.service文件中更改

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

I can't run anymore Tomcat. 我不能再运行Tomcat。 However, it works with Java 8 that has been installed through sudo apt-get install default-jdk command: 但是,它适用于通过sudo apt-get install default-jdk命令sudo apt-get install default-jdk Java 8:

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. 我建议使用Java 8或9。即使Tomcat说Tomcat 9可以支持Java 8和更高版本,也要使其稳定而不是las JRE更好。

From Tomcat site : Tomcat站点

Users were successfully running Tomcat 8 on Java 8 many months before the first stable Java 8 release. 在第一个稳定的Java 8版本发布之前的许多月,用户就已经在Java 8上成功运行了Tomcat 8。 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. 最初的早期访问版本包含可能会导致在Tomcat上运行的Web应用程序出现问题的错误的情况并不少见。

If the new Java version introduces new language features then the default JSP compiler may not support them immediately. 如果新的Java版本引入了新的语言功能,则默认的JSP编译器可能不会立即支持它们。 Switching the JSP compiler to javac may enable these new language features to be used in JSPs. 将JSP编译器切换到javac可以使这些新语言功能可以在JSP中使用。

If you do discover an problem using a Java early access build, please ask for help. 如果您确实使用Java抢先体验版本发现问题,请寻求帮助。 The Tomcat user's mailing list is probably the best place to start. Tomcat用户的邮件列表可能是最好的起点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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