I am using Tomcat addon of XAMPP.
The following error occurs when running the JSP Example That comes with Tomcat:
Ava. Lang. unsupportedclassversionerror: bad version number in. Class File
JDK on my machine is .. 0_10. The location is as follows:
Set java_home = C:/program files/Java/jdk1.6.0 _ 10
The JDK used for Tomcat is still 1.5.
Solution:
Modify the JDK directory of Tomcat
Open tomcat/bin/Catalina. BAT and find the last statement shown below:
Rem $ ID: Catalina. Bat 656834 2008-05-15 21: 04: 04z Markt $
Rem ---------------------------------------------------------------------------
Add the following statement below the statement:
Rem jsse_home (optional) may point at your Java Secure Sockets Extension
REM (JSSE) installation, whose jar files will be added to
Rem system class path used to start Tomcat.
Rem
Rem jpda_transport (optional) JPDA transport used when the "JPDA start"
Rem command is executed. The default is "dt_shmem ".
Rem
Rem jpda_address (optional) Java runtime options used when the "JPDA start"
Rem command is executed. The default is "jdbconn ".
Rem
Rem $ ID: Catalina. Bat 355227 21: 44: 16z Keith $
Rem ---------------------------------------------------------------------------
Set java_home = C:/program files/Java/jdk1.6.0 _ 10
Note: The last statement is the JDK path, which depends on your JDK installation.
Restart tomcat.