Mac OS X Activator New Platform Activation Error

I am running the latest Yosemite 10.10.3 with the latest activator from Typesafe 1.3.4 and I tried to create a new Scala Project 6 template and I can no longer run the template without this error.

[info] Loading project definition from /Users/Master/x/x/project
java.lang.UnsupportedClassVersionError: play/runsupport/classloader/ApplicationClassLoaderProvider : Unsupported major.minor version 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at play.sbt.run.PlayRun$.<init>(PlayRun.scala:35)
    at play.sbt.run.PlayRun$.<clinit>(PlayRun.scala)
    at play.sbt.PlaySettings$.defaultSettings$lzycompute(PlaySettings.scala:70)
    at play.sbt.PlaySettings$.defaultSettings(PlaySettings.scala:47)
    at play.sbt.Play$.projectSettings(Play.scala:26)
    at sbt.Load$$anonfun$autoPluginSettings$1$1.apply(Load.scala:666)
    at sbt.Load$$anonfun$autoPluginSettings$1$1.apply(Load.scala:666)
    at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
    at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
    at scala.collection.immutable.List.foreach(List.scala:318)
    at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251)
    at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105)
    at sbt.Load$.autoPluginSettings$1(Load.scala:666)
    at sbt.Load$.sbt$Load$$expandSettings$1(Load.scala:681)
    at sbt.Load$$anonfun$sbt$Load$$expandSettings$1$2.apply(Load.scala:682)
    at sbt.Load$$anonfun$sbt$Load$$expandSettings$1$2.apply(Load.scala:682)
    at scala.collection.IndexedSeqOptimized$class.foldl(IndexedSeqOptimized.scala:51)
    at scala.collection.IndexedSeqOptimized$class.foldLeft(IndexedSeqOptimized.scala:60)
    at scala.collection.mutable.WrappedArray.foldLeft(WrappedArray.scala:34)
    at scala.collection.TraversableOnce$class.$div$colon(TraversableOnce.scala:138)
    at scala.collection.AbstractTraversable.$div$colon(Traversable.scala:105)
    at sbt.Load$.sbt$Load$$expandSettings$1(Load.scala:682)
    at sbt.Load$.resolveProject(Load.scala:684)
    at sbt.Load$.finalizeProject$1(Load.scala:549)
    at sbt.Load$.loadTransitive(Load.scala:577)
    at sbt.Load$.loadProjects$1(Load.scala:442)
    at sbt.Load$.loadUnit(Load.scala:446)
    at sbt.Load$$anonfun$18$$anonfun$apply$11.apply(Load.scala:281)
    at sbt.Load$$anonfun$18$$anonfun$apply$11.apply(Load.scala:281)
    at sbt.BuildLoader$$anonfun$componentLoader$1$$anonfun$apply$4$$anonfun$apply$5$$anonfun$apply$6.apply(BuildLoader.scala:91)
    at sbt.BuildLoader$$anonfun$componentLoader$1$$anonfun$apply$4$$anonfun$apply$5$$anonfun$apply$6.apply(BuildLoader.scala:90)
    at sbt.BuildLoader.apply(BuildLoader.scala:140)
    at sbt.Load$.loadAll(Load.scala:334)
    at sbt.Load$.loadURI(Load.scala:289)
    at sbt.Load$.load(Load.scala:285)
    at sbt.Load$.load(Load.scala:276)
    at sbt.Load$.apply(Load.scala:130)
    at sbt.Load$.defaultLoad(Load.scala:36)
    at sbt.BuiltinCommands$.doLoadProject(Main.scala:481)
    at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:475)
    at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:475)
    at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:58)
    at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:58)
    at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:60)
    at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:60)
    at sbt.Command$.process(Command.scala:92)
    at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:98)
    at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:98)
    at sbt.State$$anon$1.process(State.scala:184)
    at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:98)
    at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:98)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
    at sbt.MainLoop$.next(MainLoop.scala:98)
    at sbt.MainLoop$.run(MainLoop.scala:91)
    at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:70)
    at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:65)
    at sbt.Using.apply(Using.scala:24)
    at sbt.MainLoop$.runWithNewLog(MainLoop.scala:65)
    at sbt.MainLoop$.runAndClearLast(MainLoop.scala:48)
    at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:32)
    at sbt.MainLoop$.runLogged(MainLoop.scala:24)
    at sbt.StandardMain$.runManaged(Main.scala:53)
    at sbt.xMain.run(Main.scala:28)
    at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
    at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
    at xsbt.boot.Launch$.run(Launch.scala:109)
    at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
    at xsbt.boot.Launch$.launch(Launch.scala:117)
    at xsbt.boot.Launch$.apply(Launch.scala:18)
    at xsbt.boot.Boot$.runImpl(Boot.scala:41)
    at xsbt.boot.Boot$.main(Boot.scala:17)
    at xsbt.boot.Boot.main(Boot.scala)
[error] java.lang.UnsupportedClassVersionError: play/runsupport/classloader/ApplicationClassLoaderProvider : Unsupported major.minor version 52.0

      

+3


source to share


4 answers


The latest version of the Play Framework, starting from version 2.4.0, requires Java 1.8. Update to resolve.



PlayFramework ChangeLog

+3


source


This is an important part of your stack trace:

java.lang.UnsupportedClassVersionError:      
play/runsupport/classloader/ApplicationClassLoaderProvider : Unsupported  
major.minor version 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at

      



This means that you have Java 7 installed, but it is not supported by the template. Try using template as of Java 8 instead.

+1


source


If you are using playframework 2.4.2 make sure you set your development machine to use java 1.8.0+

This is how you change your machine setup to use java 1.8 on ubuntu

  • Install java version sudo update-alternatives --config java

There are 5 alternate java options (providing / usr / bin / java).

Choice path priority status

  • 0 / usr / lib / jvm / java-8-oracle / jre / bin / java 20004 automatic mode 1 / usr / lib / jvm / java-7-openjdk-amd64 / jre / bin / java 1071 manual mode 2 / usr / lib / jvm / java-7-oracle / jre / bin / java 20002 manual mode 3 / usr / lib / jvm / java-8-oracle / bin / java 20000 manual mode 4 / usr / lib / jvm / java-8- oracle / jre / bin / java 20004 manual mode 5 / usr / lib / jvm / jre1.7.0_45 / bin / java 1 manual mode Press enter to save the current selection [*] or enter the selection number:

2.Install javac version sudo update-alternatives --config javac

There are 5 alternate java options (providing / usr / bin / java).

Choice path priority status

  • 0 / usr / lib / jvm / java-8-oracle / jre / bin / java 20004 automatic mode 1 / usr / lib / jvm / java-7-openjdk-amd64 / jre / bin / java 1071 manual mode 2 / usr / lib / jvm / java-7-oracle / jre / bin / java 20002 manual mode 3 / usr / lib / jvm / java-8-oracle / bin / java 20000 manual mode 4 / usr / lib / jvm / java-8- oracle / jre / bin / java 20004 manual mode 5 / usr / lib / jvm / jre1.7.0_45 / bin / java 1 manual mode Press enter to save the current selection [*] or enter the selection number:

    1. set JAVA_HOME to java 1.8 source (/ usr / lib / jvm / java-8-oracle / jre / bin / java)

~ / .bashrc However, for Java, I followed the instructions https://askubuntu.com/questions/55848/how-do-i-install-oracle-java-jdk-7

and that was enough for me.

you can also define multiple java_home and only include one of them (comment left commented).

suppose in your bashrc file you have

export JAVA_HOME = ...... jdk1.7

export JAVA_HOME = ...... jdk1.8

Notice 1.8 has been commented. Once you do

source ~ / .bashrc

jdk1.7 will be on its way.

you can easily switch them this way. There are other permanent solutions as well. The link I posted contains this information.

+1


source


As @nkadwa already mentioned that the latest version of the Play Framework since 2.4.0 requires Java 1.8.

It's worth noting that on Windows, the command activator

uses the environment variable JAVA_HOME

, if set, to find the Java instance to run on.

So, even if you have Java 8 installed, the JAVA_HOME

env variable may point to an older version of the JDK. Perhaps this is one of the reasons for this error.

Set the variable JAVA_HOME

to point to the new JDK version, or remove the variable JAVA_HOME

(if you just want to use the JRE) to fix this problem.

0


source







All Articles