I have the JRE 1.6 and 1.7 installed (as well as the JDK) in c:/program files/java/
I first had 1.7 installed then installed 1.6 as well. I am using Eclipse as my IDE -please note I am new to Java.
When I want to switch to 1.6 I go to "Run configurations" (in Eclipse) and select alternative JREs, pick 1.6 and click apply. But when I try to run a simple HelloWorld program I get this alert:
Could not find the main class:HelloW. Program will exit.
And in the console I get these errors:
java.lang.UnsupportedClassVersionError: HelloW : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
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$000(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)
If I switch back to JRE 1.7 everything works again. How can I properly switch to 1.6 and get everything working?