• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Change Tomcat's JDK Version

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use Tomcat 5.5.9 , and the JVM it uses java 5
how can I change the Java version to 6.0?
is there any configuration file which I can edit,
I tried server.xml or catalina.property file, they seem
not the right one. help please

Regards
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Go to tomcat/bin and modify the JAVA_HOME parmater in catalina.sh (for linux/unix) or catalina.bat (for windows)
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

benjamin muktesh wrote:Go to tomcat/bin and modify the JAVA_HOME parmater in catalina.sh (for linux/unix) or catalina.bat (for windows)


Ive been searching for days for this solution,
I've had this error and now it's solved:
javax.servlet.ServletException: Bad version number in .class file
for my Java Server Faces JSF beans which all gave errors.
 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which JRE version and which JSF version are you using? JSF 1.2 requires at least Java 5 (since it's part of JEE 5), while JSF 2.0 requires Java 6 (since it's part of JEE 6).

Is there a class file version number given in the error message? Should be a number around 50.
 
Bert Bertens
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:Which JRE version and which JSF version are you using? JSF 1.2 requires at least Java 5 (since it's part of JEE 5), while JSF 2.0 requires Java 6 (since it's part of JEE 6).

Is there a class file version number given in the error message? Should be a number around 50.



No I meant with my post that my problem was already solved. After googling my error I found that there's a JDK difference between Tomcat and Maven, so I just googled how to change Tomcat's JDK version and found this thread. But I had been searching long before I realised that the JDK difference was the problem (I had two JDK's on my pc and the system environment variable pointed to the outdated JDK, which Tomcat uses) so I thought I'd post the error message here so Googlers might end up here.
 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


SEVERE: Servlet.service() for servlet RestServlet threw exception
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1815)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1325)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.restlet.engine.Engine.loadClass(Engine.java:242)




Hello I am struggling with the same error.
My server side application is using jdk 1.5 specification.
when I build it through eclipse 1.5 compliance setting and exporting it as a war file to the server tomcat web apps folder. I am getting the same error.
I have build the application using dynamic web project 2.4.
In project facets section I have following points checked.

1.Dynamic web module :2.4
2.Java :1.5

Will my windows environment variable affect the eclipse build settings??



 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic