SebT
SebT

Reputation: 472

java.lang.UnsupportedClassVersionError when following tutorial

I'm trying to use Play! but I always get an error when trying to run a project: [error] java.lang.UnsupportedClassVersionError: com/typesafe/config/ConfigException : Unsupported major.minor version 52.0

When I do java -version or javac -version, it confirms I'm using Java 8 by outputting 1.8.0_45. I don't understand why this error happens, the docs says I NEED java 8 for the latest Play! version, the project has a dependency to Play! 2.4.2.

I followed the documentation: installed activator, added it to the path, generated a new project form the template 'java-play-intro' but when i type activator in my project directory, I always get the error above. I tried to use the update-alternative command to use java 6 and then 7 but the error is exactly the same.

BUT when I use activator ui it works fine !

How is this possible? Am I always supposed to use the UI?

Upvotes: 3

Views: 703

Answers (1)

Ton Bosma
Ton Bosma

Reputation: 181

Most probably the script you are starting, uses the JAVA_HOME environment variable and not the JDK binaries that can be found on your PATH.

Upvotes: 4

Related Questions