How do i resolve this error...i know this exception should be thrown only when i am using an older version jre to run my class file which should be compiled with a newer jdk but i have jdk 1.6 update 18 and jre 1.6 update 21 .

thanks for any help.

Post some code.

it displays this exception when i try to run it from command line . it does not depend on any codes . none of the .class file is getting executed .

Do have the JAVA_HOME environment variable set. After doing some searching, and now I remember that I had the same problem, I found that you have to put first the latest java version that you are using when declaring that variable. You must also set your classpath correctly in order to use the latest java version when compiling and running

After very little search, I found this page:
http://www.devdaily.com/blog/post/java/java-lang-unsupportedclassversionerror/

This question has already been answered. Start a new discussion instead.