简体   繁体   中英

Play Framework: Java version prior to 1.8 are not supported

I have an Ubuntu server running Ubuntu 16.04.5 LTS. My PlayFramework version is 1.5.1.

I get the following error, and I cannot figure out why:

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)

The Java version I am running is 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)

I have also tried Java 11, but get the same error:

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)

Under alternatives I get the following, showing no pre-1.8 java versions.

  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

Issuing the 'play run' command also confirms it is using 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.

The problem was the optional setting in the configuration file. The compiler version can be overruled there.

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