java - Tomcat 9 无法在 Ubuntu 上使用 Java 10

标签 java apache ubuntu tomcat server

我已经用这个命令下载了 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

安装成功,通过java -version可以看到Java版本

但是当我在 tomcat.service 文件中更改

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

我不能再运行 Tomcat。但是,它适用于通过 sudo apt-get install default-jdk 命令安装的 Java 8:

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

最佳答案

好的。我建议使用 Java 8 或 9。即使 Tomcat 说 Tomcat 9 可以支持 Java 8 和更高版本更好地稳定而不是 las JRE。

来自 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.

关于java - Tomcat 9 无法在 Ubuntu 上使用 Java 10,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50948436/

相关文章:

java - Javafx 的新阶段即将到来

java - SpringBoot 不处理 org.hibernate.exception.ConstraintViolationException

java - 如何创建一个新的 SequenceGenerator 来生成唯一值?

php - 在 PHP 中使用 exec() 发出 HTTPS SVN 命令行请求

.net - System.Net.WebClient 请求得到 403 Forbidden 但浏览器没有使用 Apache 服务器

python - 为什么在 apache 上找不到 python 模块

ubuntu - 在 ubuntu 中更改 "/usr/bin/time"分析器的精度数字

java - 如何在android中使用位图/可绘制而不是颜色常量

java - Ubuntu 上的 Glassfish JDBC 连接池问题

java - 单独进程控制java或linux脚本