i just get my first java class with javac the source file is called vio1.java javac generated vio1.class when i try : java vio1 i get this: D:\ZX JAVA APL>java vio1 Exception in thread "main" java.lang.UnsupportedClassVersionError: vio1 (Unsuppo rted 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)
That is peculiar - usually this error points to a version mismatch between the class file and the JVM being used to run it. Do you have more than one JVM/JRE installed on your machine? Check that "java -version" and "javac -version" both report the same verison number.
Joined: Nov 04, 2006
Thank you very much Ulf. I have more than one version. java.exe exists also in a 'macromedia\..\jvm' folder. What is the simple way to rezolve that?
thanks again, vio
Joined: Mar 22, 2005
Do "java -version" and "javac -version" report the same version?
Originally posted by Viorel Dragos: I have more than one version. java.exe exists also in a 'macromedia\..\jvm' folder. What is the simple way to rezolve that?
Make sure that you are using the right Java version when you compile and run things. Set the PATH environment variable correctly (see step 5 of the Installation Notes) so that Windows finds the JVM you've just installed instead of the JVM in the Macromedia folder.