This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error while running a program

 
Moieen Khatri
Ranch Hand
Posts: 144
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have jdk 1.4 installed on my computer.Whenever I write a sample program I'm able to compile it but on running the program from cmd prompt it gives the following error message:


Exception in thread "main" java.lang.UnsupportedClassVersionError: DateTest (Uns
upported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)


Can someone please advice?

Thanks in advance
 
Moieen Khatri
Ranch Hand
Posts: 144
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get this error while running any program


Thanks
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error message means that you have compiled your code with JDK 1.5, and now you are trying to run it on Java 1.4.

You can run Java programs compiled with an older version on a newer version, but not the other way around. (So compiling on JDK 1.4 and running on Java 5 works, but not compiling on JDK 1.5 and running on Java 1.4).

If your code needs to run on Java 1.4, then use JDK 1.4 instead of JDK 1.5.
 
Moieen Khatri
Ranch Hand
Posts: 144
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks...I ran set path=myjdkpathtillbinfolder from cmd and the issue is resolved now.

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic