Wednesday, April 20, 2016

[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(
    at Method)
    at java.lang.ClassLoader.loadClass(
    at sun.misc.Launcher$AppClassLoader.loadClass(
    at java.lang.ClassLoader.loadClass(
    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)

No comments:

Post a Comment