java.lang.UnsupportedClassVersionError:
java.lang.UnsupportedClassVersionError:
When I try to compile the simple Hello program there was no problem but when trying to compile it but its giving error when tyring to run the class file
class Hello
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
Exception in thread "main" java.lang.UnsupportedClassVersionError:
HelloWorld (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
is the error I am getting.......
Solution:
Set the path using:
C:\oracle\ora92\bin;C:\Program Files\Oracle\jre\Change it to the latest version you have installed(1.5.0 in my case)\bin;
The error has occured becuase you have compiled the program with a latest version and trying to run it using a version which is older version.... so make it to a new version.
When I try to compile the simple Hello program there was no problem but when trying to compile it but its giving error when tyring to run the class file
class Hello
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
Exception in thread "main" java.lang.UnsupportedClassVersionError:
HelloWorld (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
is the error I am getting.......
Solution:
Set the path using:
C:\oracle\ora92\bin;C:\Program Files\Oracle\jre\Change it to the latest version you have installed(1.5.0 in my case)\bin;
The error has occured becuase you have compiled the program with a latest version and trying to run it using a version which is older version.... so make it to a new version.