• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

java.lang.UnsupportedClassVersionError

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I have created one jar file from my eclipse ide and
if i go to command prompt and try to run it from there then i'm
getting

java.lang.UnsupportedClassVersionError

so i thought may be my jre version is older and i went to
C:\Program Files\Java and saw so many versions of jdk and jre a

jdk1.5.0_06
jdk1.6.0_30
jdk1.6.0_35
jre1.5.0_06
jre6
jre7

and in my environment variable has classpath: .;C:\Program Files\Java\jdk1.6.0_35\bin
so i think my jdk version is jdk1.6.0_35.


thanks in advance
 
Marshal
Posts: 25814
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The classpath does not specify the Java version being used. Also, putting C:\Program Files\Java\jdk1.6.0_35\bin in the classpath will have no effect as there are no .class files in that folder (hopefully you didn't put any there). So take that out, otherwise it's just going to lead to confusion.

If you want to know what version of Java is run by the "java" command, then type "java -version" at the command line.
 
RabiDas Sharma
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java -version gives: java version 1.6.0_35

then how can i solve this problem please help me


with regards
 
Paul Clapham
Marshal
Posts: 25814
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Either change your path (the PATH environment variable, not the classpath) to include the JRE you want, or change the current working directory to include that JRE's directory.
 
author & internet detective
Posts: 40198
816
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From your other threads, it sounds like you created the jar using Java 7 and are running it using Java 6. Can you try running it with Java 7?
 
I've got no option but to sell you all for scientific experiments. Or a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic