[PLAY-FRAMEWORK] UnsupportedClassVersionError: com/typesafe/config/ConfigException : Unsupported major.minor version 52.0

[PLAYFRAMEWORK] Using JRE for running java binary/application made of PLAY framework::


On production system its better not to use JDK as it has compiler on it. So only JAVA runtime installation should do the trick for running PLAY-FRAMEWORK based java application. Its basically REST service providing server.
So lets see how it is done,

code for symbolic link:
  $ export JAVA_HOME=/usr/java/jre1.8.0_91/  $ export PATH=$PATH:$JAVA_HOME/bin
  $ ./your_play_frameworkbased_app


All are done in the same console which doesn't store the JAVA HOME on the system path. 

If the specified  JRE/JDK version is not available on system path or on execution console then running PLAY framework based application will provide following error trace,


Exception in thread "main" 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: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 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at play.core.server.ProdServerStart$.readServerConfigSettings(ProdServerStart.scala:76)
    at play.core.server.ProdServerStart$.start(ProdServerStart.scala:37)
    at play.core.server.ProdServerStart$.main(ProdServerStart.scala:22)
    at play.core.server.ProdServerStart.main(ProdServerStart.scala)

Post a Comment