• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Approaches To Solving UnsupportedClassVersionError

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

After uploading my web application to my hosting company, i'm receiving an UnsupportedClassVersionError. I'm figuring this is because i've compiled my classes using JDK 1.5.0_06 whilst the JVM running in my host's server is the older 1.4.2_08. Obviously, if this was on my own machine i would just update the JVM. I'm not sure how keen my host will be though to do the same. Therefore, i was wondering if there are any other approaches to solve this problem. Obviously i could change my JDK to 1.4.2 and recompile but this somehow seems to be unsatisfactory...although i will do it if its the only solution. After reading a similar post from a couple of years back, someone replied with using switches. What are these and how do you use them? Any other comments would be greatly appreciated.

Cheers!
 
Ranch Hand
Posts: 2412
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I haven't experimented with this, but there is a compiler switch -source that will allow you to specify a source to use when compiling.
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can recompile your program like this:

javac -source 1.4 -target 1.4 MyProgram.java
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic