jQuery in Action, 2nd edition*
The moose likes Tomcat and the fly likes UnsupportedClassVersionError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "UnsupportedClassVersionError" Watch "UnsupportedClassVersionError" New topic
Author

UnsupportedClassVersionError

Anjana Ravindran
Ranch Hand

Joined: Aug 22, 2005
Posts: 76
Getting error
java.lang.UnsupportedClassVersionError: org/apache/jsp/jsp/index_jsp

Problem shd be my environment variables or version incompatibility between jdk and oracle

Path
C:\Oracle\product\10.1.0\Client_1\bin;C:\Oracle\product\10.1.0\Client_1\jre\1.4.2\bin\client;C:\Oracle\product\10.1.0\Client_1\jre\1.4.2\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\GemPlus\GemSafe Libraries User\Bin;C:\Program Files\Microsoft SQL Server\80\Tools\BINN

CLASSPATH
C:\Program Files\jakarta-tomcat-5.0.28\webapps\cvisit\WEB-INF\lib\activation.jar;C:\Program Files\jakarta-tomcat-5.0.28\webapps\cvisit\WEB-INF\lib\common_java.jar;C:\Program Files\jakarta-tomcat-5.0.28\webapps\cvisit\WEB-INF\lib\commons-dbcp-1.2.1.jar;C:\Program Files\jakarta-tomcat-5.0.28\webapps\cvisit\WEB-INF\lib\commons-lang-2.1.jar;C:\Program Files\jakarta-tomcat-5.0.28\webapps\cvisit\WEB-INF\lib\commons-logging.jar;C:\Program Files\jakarta-tomcat-5.0.28\webapps\cvisit\WEB-INF\lib\commons-pool-1.2.jar;C:\Program Files\jakarta-tomcat-5.0.28\webapps\cvisit\WEB-INF\lib\CuisBeans.jar;C:\Program Files\jakarta-tomcat-5.0.28\webapps\cvisit\WEB-INF\lib\jcommon-1.0.0-rc1.jar;C:\Program Files\jakarta-tomcat-5.0.28\webapps\cvisit\WEB-INF\lib\mail.jar;C:\Program Files\jakarta-tomcat-5.0.28\webapps\cvisit\WEB-INF\lib\servlet.jar;C:\Program Files\jakarta-tomcat-5.0.28\webapps\cvisit\WEB-INF\lib\servlet-api.jar;C:\Program Files\jakarta-tomcat-5.0.28\webapps\cvisit\WEB-INF\lib\struts.jar;C:\Program Files\jakarta-tomcat-5.0.28\webapps\cvisit\WEB-INF\lib\strutscommons.jar;C:\Program Files\jakarta-tomcat-5.0.28\webapps\cvisit\WEB-INF\lib\tools.jar;C:\Program Files\jakarta-tomcat-5.0.28\webapps\cvisit\WEB-INF\lib\userlookup.jar;C:\Program Files\jakarta-tomcat-5.0.28\webapps\cvisit\WEB-INF\lib\wssolite-filter.jar;C:\Program Files\jakarta-tomcat-5.0.28\webapps\cvisit\WEB-INF\lib\classes12.zip

JAVA_HOME
C:\Oracle\product\10.1.0\Client_1\jdk

Versions
JDK version in Oracle - JDK 1.4.2
Tomcat runs using JAVA_HOME, so uses jdk 1.4.2

Can you please help me in finding out wats the problem and how to solve the same
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

THis is just the obvious JDK1.5/JDK1.4 confusion, but the proper fix may be Tomcat-specific, so I'm going to move this to our Tomcat forum.


[Jess in Action][AskingGoodQuestions]
Anjana Ravindran
Ranch Hand

Joined: Aug 22, 2005
Posts: 76
Problem is fixed. But i am quite puzzled by this behavior. Please help me in reasoning out.

I have jdk 3 places in my places
1. One i downloaded earlier - C:\j2sdk1.4.2 (jdk version - 1.4.2)
2. Another got installed on installing oracle - C:\Oracle\product\10.1.0\Client_1\jdk (jdk version 1.4.2)
3. Another got installed on installing j2ee sdk - C:\Sun\AppServer\jdk (jdk version 5.0)

I have 2 environment variables pointing to jdk - Path and JAVA_HOME

I am trying to run a web application which runs on tomcat server. Tomcat refers JAVA_HOME variable for jdk reference. Oracle uses Path environment variable for jdk reference.
I like to have both of them to point to same jdk so there wont be any problem.

If i make both of them to point to Oracle jdk as given below
Path - C:\Oracle\product\10.1.0\Client_1\bin;
JAVA_HOME - C:\Oracle\product\10.1.0\Client_1\jdk

Oracle is working and my web application gives the following error
java.lang.UnsupportedClassVersionError: org/apache/jsp/jsp/index_jsp (Unsupported major.minor version 49.0)

If i make changes as given below,
Path - C:\Oracle\product\10.1.0\Client_1\bin;
JAVA_HOME - C:\Sun\AppServer\jdk
Both Oracle and web application is working.

Please let me know why it is giving error saying unsupported version if i make both of them same.
Naseem Khan
Ranch Hand

Joined: Apr 25, 2005
Posts: 809
Such type of problem come when the version of compiler and interpreter is not same.

Naseem


Asking Smart Questions FAQ - How To Put Your Code In Code Tags
Anjana Ravindran
Ranch Hand

Joined: Aug 22, 2005
Posts: 76
How do i find the version of compiler and interpreter? Just like to know whats really going on.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

On *nix boxes, I use the "which" command and look at the path:
The 'java' command has a -version option.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
jQuery in Action, 2nd edition
 
subject: UnsupportedClassVersionError
 
Similar Threads
Problem compiling a Java Program
Axis problem
APR based Apache Tomcat Native library which allows optimal performance in production environments w
Problem starting TOMCAT version 5
when i try run: weka.jar i get these error: "Error: Could not find Java 2 Runtime "