Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Approaches To Solving UnsupportedClassVersionError

 
Marcus Hathaway
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • 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!
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • 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.
 
Mark Van Tuyl
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can recompile your program like this:

javac -source 1.4 -target 1.4 MyProgram.java
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic