• 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

Unsupported major.minor version 49.0

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm getting this error message when I try to run a SIMPLE java application. Any idea why?

My source code is:

class VolcanoApplication {
public static void main() {
// public static void main(String[] arguments) {
// // VolcanoRobot dante = new VolcanoRobot();
// dante.status = "exploring";
// dante.speed = 2;
// dante.temperature = 510;

// dante.showAttributes();
// System.out.println("Increasing speed to 3.");
// dante.speed = 3;
// dante.showAttributes();
// System.out.println("Changing temperature to 670.");
// dante.temperature = 670;
// dante.showAttributes();
// System.out.println("Checking the temperature.");
// dante.checkTemperature();
// dante.showAttributes();
}
}

My output is:

C:\Documents and Settings\Eric.Goforth\My Documents\MyJavaSrc>java VolcanoApplic
ation
Exception in thread "main" java.lang.UnsupportedClassVersionError: VolcanoApplic
ation (Unsupported 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)

-Eric
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Eric,

Welcome to JavaRanch!

It looks like you've got more than one Java version installed. You're compiling with JDK 1.5 (version 49.0) and running with something earlier.

Check your PATH, and also look for a stray copy of java.exe in your Windows folder.
 
Eric Goforth
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've got java.exe's all over the place. I found the whereis command at http://blogs.msdn.com/oldnewthing/archive/2005/01/20/357225.aspx and used it to find out that I was using the one in my c:\windows\system32 directory. I renamed it to java.xxx, hopefully this won't hurt anything. My code now runs.

-Eric
 
Create symphonies in seed and soil. For this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic