play 2.3.10 with Exception "Unsupported major.minor version 52.0"

1,267 views
Skip to first unread message

Deanzz

unread,
Aug 8, 2015, 8:08:44 AM8/8/15
to play-framework
Hi all,

I want to upgrade my play version from 2.3.8 to 2.3.10 with jdk 7.
My java version is "1.7.0_11", OS is OSX Yosemite(10.10.4).
I see that 2.4.x require Java 8, so I download Play 2.3.10 (activator) on page https://www.playframework.com/download.
But I got the error 
"java.lang.UnsupportedClassVersionError: com/typesafe/config/ConfigException : Unsupported major.minor version 52.0" 
when I was compiling my project.
How did I got Java 8 compatible files?
Please help me solve the issue.
Thanks so much.

Error log:

java.lang.UnsupportedClassVersionError: com/typesafe/config/ConfigException : Unsupported major.minor version 52.0


        at java.lang.ClassLoader.defineClass1(Native Method)


        at java.lang.ClassLoader.defineClass(ClassLoader.java:791)


        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:423)


        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)


        at com.typesafe.sbt.web.SbtWeb$$anonfun$com$typesafe$sbt$web$SbtWeb$$load$1.apply(SbtWeb.scala:535)


        at com.typesafe.sbt.web.SbtWeb$$anonfun$com$typesafe$sbt$web$SbtWeb$$load$1.apply(SbtWeb.scala:535)


        at scala.Option.fold(Option.scala:157)


        at com.typesafe.sbt.web.SbtWeb$.com$typesafe$sbt$web$SbtWeb$$load(SbtWeb.scala:549)


        at com.typesafe.sbt.web.SbtWeb$$anonfun$globalSettings$1$$anonfun$apply$1.apply(SbtWeb.scala:143)


        at com.typesafe.sbt.web.SbtWeb$$anonfun$globalSettings$1$$anonfun$apply$1.apply(SbtWeb.scala:143)


        at scala.Function1$$anonfun$andThen$1.apply(Function1.scala:55)


        at sbt.Project$.setProject(Project.scala:319)


        at sbt.BuiltinCommands$.doLoadProject(Main.scala:484)


        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)



Johan Andrén

unread,
Aug 8, 2015, 9:46:08 AM8/8/15
to play-framework
This probably means you are still running Java 1.7. Activator does not contain a Java version, you will need to download and install Java 1.8 and make sure that is the default, you can check by running java -version in a terminal window.

Java 8 downloads can be found here: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

--
Johan Andrén
Typesafe -  Reactive apps on the JVM
Twitter: @apnylle
...

Deanzz

unread,
Aug 8, 2015, 10:26:12 PM8/8/15
to play-framework
Thanks for your reply.

But I can only use java 1.7 for some reason, so I want to upgrade to the latest version of play framework for java 1.7, 
I saw the change log after version 2.3.8, found that only after 2.4.0 need java 1.8, so I upgraded to 2.3.10,
Then the error has occurred....

Any other idea?
Thanks.


在 2015年8月8日星期六 UTC+8下午9:46:08,Johan Andrén写道:

Mirco Dotta

unread,
Aug 9, 2015, 4:33:55 AM8/9/15
to play-fr...@googlegroups.com
Hi,

It seems you have a dependency on the typesafe config 1.3.0, which is only usable with Java8. By looking at the stracktrace, you can see that sbt-web is using the config lib. I guess the sbt-web version you are using has a dependency on a version of akka (likely 2.3.9), which has itself a dependency on the typesafe config 1.3.0, causing the UnsupportedClassVersionError. The solution would be to downgrade sbt-web to v1.1.1 in your project (because sbt-web 1.1.1 is Java6+ compatible).

However, if you didn’t make any change in your build when upgrading activator (i.e., your project was compiling/running before upgrading activator), then I don’t have a good explanation why this is happening. If that’s the problem, it would be great if you could publish your project somewhere and provide the exact steps to reproduce the issue.

Cheers,
Mirco
----------------
Mirco Dotta - @mircodotta

Typesafe – Build reactive apps!

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/1c30a150-86d5-4c7a-aacf-94f81e3d6917%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

signature.asc

Mirco Dotta

unread,
Aug 9, 2015, 4:44:52 AM8/9/15
to play-fr...@googlegroups.com
Correction: akka 2.3.9 doesn’t have a dependency on the typesafe config 1.3.0, but actually on 1.2.1 (which is OK for java6+). See https://github.com/akka/akka/blob/7bdb272ca9699b882408a47d27b005cf8f966ebd/project/AkkaBuild.scala#L1239. Hence, downgrading sbt-web won’t help, since it’s not the one to blame for pulling the typesafe config 1.3.0 in your classpath. Sorry for pointing you in the wrong direction.

My advise is to debug your build to find out why/how you are getting the typesafe config 1.3.0 in your classpath (sbt-dependency-graph may be handy).

----------------
Mirco Dotta - @mircodotta

Typesafe – Build reactive apps!

signature.asc

Deanzz

unread,
Aug 9, 2015, 10:44:47 PM8/9/15
to play-framework
Hi Dotta,

Thanks for your reply.

I tried 2 solution.
1. Remove the contents of these folders
    ~/.sbt, ~/.ivy and ~/.activator.
   Then I get all of the dependencies again.
   It doesn't worked.

2. Your advice.
    I installed sbt-dependency-graph, but I also get the same error before print the dependency-tree, I don't know what I can do next.
    I tried
    1) Go to my project folder
        cd ogp-vlt
    2) Execute "./activator dependency-tree"
    3) Choose ignore

    The entire log:


localhost
:ogp-vlt dean$ ./activator dependency-tree


[info] Loading global plugins from /Users/dean/.sbt/0.13/plugins


[info] Loading project definition from /Users/dean/Work/Hainan/Source/ogp-vlt/project


[info] Set current project to ogp-vlt (in build file:/Users/dean/Work/Hainan/Source/ogp-vlt/)

[error] java.lang.UnsupportedClassVersionError: com/typesafe/config/ConfigException : Unsupported major.minor version 52.0


[error] Use 'last' for the full log.


Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? i


[warn] Ignoring load failure: no project loaded.


[error] Not a valid command: dependency-tree


[error] dependency-tree


[error]  







     


在 2015年8月9日星期日 UTC+8下午4:44:52,Mirco Dotta写道:
...

Mirco Dotta

unread,
Aug 10, 2015, 3:15:30 AM8/10/15
to play-fr...@googlegroups.com
Hi Dotta,

Thanks for your reply.

I tried 2 solution.
1. Remove the contents of these folders
    ~/.sbt, ~/.ivy and ~/.activator.
   Then I get all of the dependencies again.
   It doesn't worked.

2. Your advice.
    I installed sbt-dependency-graph, but I also get the same error before print the dependency-tree, I don't know what I can do next.

Good point.

Maybe you could use Java8 just to find who is to blame for adding the typesafe config in your classpath. If that’s not a viable solution, then I don’t have a better alternative than manually checking your dependencies :-)



--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
signature.asc
Reply all
Reply to author
Forward
0 new messages