please uninstall both the jdk 1.5 and the previous versions of jdk that you have installed. restart the system and then install only the jdk 1.5. also check the path and classpath in environment variables of the device manager.
U dont need to uninstall both the jre. U have have multiple versions of JRE in ur System with out any problem
This exception can occur when the source is built targeting a JDK that is not supported by the JDK attempting to run it or the other way. In the above example, if the servlet was built targeting only JDK 1.5, but the web server runs JDK 1.4, the above exception will occur.
Check, Project Properties | Build | Java | Target VM, and verify that the Target VM indicates a JDK compatibility that is appropriate for the JDK that is running it.