• 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

Exception in thread "main" java

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i just get my first java class with javac
the source file is called vio1.java
javac generated vio1.class
when i try :
java vio1
i get this:
D:\ZX JAVA APL>java vio1
Exception in thread "main" java.lang.UnsupportedClassVersionError: vio1 (Unsuppo
rted 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 you help me?
thanks
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That is peculiar - usually this error points to a version mismatch between the class file and the JVM being used to run it. Do you have more than one JVM/JRE installed on your machine? Check that "java -version" and "javac -version" both report the same verison number.
 
Viorel Dragos
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much Ulf.
I have more than one version. java.exe exists also in a 'macromedia\..\jvm' folder.
What is the simple way to rezolve that?

thanks again,
vio
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do "java -version" and "javac -version" report the same version?
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Viorel Dragos:
I have more than one version. java.exe exists also in a 'macromedia\..\jvm' folder.
What is the simple way to rezolve that?


Make sure that you are using the right Java version when you compile and run things. Set the PATH environment variable correctly (see step 5 of the Installation Notes) so that Windows finds the JVM you've just installed instead of the JVM in the Macromedia folder.
 
Viorel Dragos
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks everyone for help.
the problem was solved.
i removed the macromedia dreamweaver (demo version...) and clean the registry.
'hello word' run corectly now
vio
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic