我有一台运行Ubuntu 16.04.5 LTS的Ubuntu服务器。 我的PlayFramework版本是1.5.1。
我收到以下错误,但我不知道为什么:
Nov 05 22:25:54 playframework[860]: SEVERE:
Nov 05 22:25:54 playframework[860]: @79nn5m673
Nov 05 22:25:54 playframework[860]: Failed to start
Nov 05 22:25:54 playframework[860]: Compilation error
Nov 05 22:25:54 playframework[860]: The file could not be compiled. Error raised is : Java version prior to 1.8 are not supported
Nov 05 22:25:54 playframework[860]: play.exceptions.CompilationException: Java version prior to 1.8 are not supported
Nov 05 22:25:54 playframework[860]: at play.classloading.ApplicationCompiler.<init>(ApplicationCompiler.java:64)
Nov 05 22:25:54 playframework[860]: at play.classloading.ApplicationClasses.<init>(ApplicationClasses.java:29)
Nov 05 22:25:54 playframework[860]: at play.Play.init(Play.java:219)
Nov 05 22:25:54 playframework[860]: at play.server.Server.main(Server.java:162)
我正在运行的Java版本是Oracle Java 1.8:
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
我也尝试过Java 11,但收到相同的错误:
javac 11.0.1
java 11.0.1 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)
在替代方案下,我得到以下内容,没有显示1.8之前的Java版本。
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-11-oracle/bin/java 1091 auto mode
* 1 /usr/lib/jvm/java-11-oracle/bin/java 1091 manual mode
2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode
3 /usr/lib/jvm/java-8-oracle/jre/bin/java 1081 manual mode
发出“ play run”命令还确认它正在使用Java 11:
~ _ _
~ _ __ | | __ _ _ _| |
~ | '_ \| |/ _' | || |_|
~ | __/|_|\____|\__ (_)
~ |_| |__/
~
~ play! 1.5.1, https://www.playframework.com
~
~ Ctrl+C to stop
~
~ using java version "1.8.0_191"
Listening for transport dt_socket at address: 8000
Nov 05, 2018 10:37:44 PM play.Logger niceThrowable
SEVERE:
@79nn7ahaj
Failed to start
Compilation error
The file could not be compiled. Error raised is : Java version prior to 1.8 are not supported
play.exceptions.CompilationException: Java version prior to 1.8 are not supported
at play.classloading.ApplicationCompiler.<init>(ApplicationCompiler.java:64)
at play.classloading.ApplicationClasses.<init>(ApplicationClasses.java:29)
at play.Play.init(Play.java:219)
at play.server.Server.main(Server.java:162)
There must be a simple explanation for this, but I cannot find it.
答案 0 :(得分:0)
问题是配置文件中的可选设置。可以在此处否决编译器版本。