Monday, April 29, 2013

"ceylon" command throwing "UnsupportedClassVersionError" exception

When i was trying to install and configure classpath for Ceylon programming language to begin coding i was getting this error which does not describe it self.


 Exception in thread "main" java.lang.UnsupportedClassVersionError: com/redhat/ce  
 ylon/launcher/CeylonClassLoader : Unsupported major.minor version 51.0  
     at java.lang.ClassLoader.defineClass1(Native Method)  
     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)  
     at java.lang.ClassLoader.defineClass(ClassLoader.java:615)  
     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14  
 1)  
     at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)  
     at java.net.URLClassLoader.access$000(URLClassLoader.java:58)  
     at java.net.URLClassLoader$1.run(URLClassLoader.java:197)  
     at java.security.AccessController.doPrivileged(Native Method)  
     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)  
     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)  
     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)  
     at java.lang.ClassLoader.loadClass(ClassLoader.java:247)  
 Could not find the main class: com.redhat.ceylon.launcher.Launcher. Program will  
  exit.  

The mistake i did at the beginning seems to be avoid reading the "README.md" file in ceylon package. In there it clearly stated that "Ceylon execute on any Java 7 compatible JVM ... "

So the above error gives because of the incompatible JVM version. (as it says in the line "Unsupported major.minor version 51.0" ).

So to fix this what you need to do is simply install the JDK 7 and add it to the classpath, JAVA_HOME and JRE_HOME. That will fix this.

HAPPY CEYLON CODING !!!


No comments:

Post a Comment