Results 1 to 15 of 15
- 12-25-2010, 03:56 AM #1
Member
- Join Date
- Dec 2010
- Posts
- 8
- Rep Power
- 0
Exception in thread "main" java.lang.UnsupportedClassVersionError: hi (Unsupport ed m
THE ERROR MSG:
E:\>javac hi.java
E:\>java hi
Exception in thread "main" java.lang.UnsupportedClassVersionError: hi (Unsupport
ed major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknow n 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)
i am using orcle 10g in my system,
is there any necessity to set classpath for orcle to get normal j2se prgm result.
iam using jdk 1.5
plz give me info about error
- 12-25-2010, 04:01 AM #2
Senior Member
- Join Date
- Dec 2010
- Posts
- 165
- Rep Power
- 3
the error can happen when you compile the class file with a higher version compiler and then runs it using a lower version. make sure you check your java version.
- 12-25-2010, 04:29 AM #3
Member
- Join Date
- Dec 2010
- Posts
- 8
- Rep Power
- 0
thanku sir
iam also try to solve using jdk 1.6 vesion ,
but same thread came
- 12-25-2010, 04:33 AM #4
Member
- Join Date
- Dec 2010
- Posts
- 8
- Rep Power
- 0
regarding java prbl
iam using WINDOWS SP-3 ,
- 12-25-2010, 10:10 AM #5
What do the following print to the console?
Make sure you copy the console output here -- don't paraphrase.Java Code:javac -version java -version
db
- 12-25-2010, 10:59 AM #6
Member
- Join Date
- Dec 2010
- Posts
- 8
- Rep Power
- 0
java & javac versions
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\room>javac -version
javac 1.5.0
javac: no source files
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are u
sed
-classpath <path> Specify where to find user class files
-cp <path> Specify where to find user class files
-sourcepath <path> Specify where to find input source files
-bootclasspath <path> Override location of bootstrap class files
-extdirs <dirs> Override location of installed extensions
-endorseddirs <dirs> Override location of endorsed standards path
-d <directory> Specify where to place generated class files
-encoding <encoding> Specify character encoding used by source files
-source <release> Provide source compatibility with specified release
-target <release> Generate class files for specific VM version
-version Version information
-help Print a synopsis of standard options
-X Print a synopsis of nonstandard options
-J<flag> Pass <flag> directly to the runtime system
C:\Documents and Settings\room>java -version
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)
C:\Documents and Settings\room>
- 12-25-2010, 12:11 PM #7
Senior Member
- Join Date
- Dec 2010
- Posts
- 165
- Rep Power
- 3
you have a 1.5 version compiler, but your java version is 1.4.2. try using the same version, either by reinstalling , changing your execution path, or specifying the full path of where your java.exe is installed when you run the class.
- 12-25-2010, 12:17 PM #8
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
That's the answer: the versions of your JDK (javac.exe etc.) and your JRE (java.exe etc.) don't match. Install matching versions; the latest version of both is version 1.6. Note: if you install a JDK the JRE comes with it.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 12-26-2010, 04:28 AM #9
Member
- Join Date
- Dec 2010
- Posts
- 8
- Rep Power
- 0
thanku
i also trying with jdk1.6,
but the same error msg came
- 12-26-2010, 04:48 AM #10
Member
- Join Date
- Dec 2010
- Posts
- 8
- Rep Power
- 0
the console error msg from promt
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\room>javac -version
javac 1.6.0_14
C:\Documents and Settings\room>java -version
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)
C:\Documents and Settings\room>e:
E:\>javac hi.java
E:\>java hi
Exception in thread "main" java.lang.UnsupportedClassVersionError: hi (Unsupport
ed major.minor version 50.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknow n 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)
- 12-26-2010, 06:00 AM #11
Senior Member
- Join Date
- Dec 2010
- Posts
- 165
- Rep Power
- 3
which part of our explanation do you not understand? you have javac version 1.6, but you are running your program using java version 1.4.2. if possible, uninstall your 1.4.2 . Or, check where you install your 1.6 and then update your PATH environment variable to point to 1.6
- 12-26-2010, 07:08 AM #12
Member
- Join Date
- Dec 2010
- Posts
- 8
- Rep Power
- 0
thanku
iam newly downloaded ====jdk-6u23-windows-i586,
after instalation I set AS
classpath:C:\Program Files\Java\jdk1.6.0_23\lib;.;
JAVA_HOME:C:\Program Files\Java\jdk1.6.0_23
path:C:\Program Files\Java\jdk1.6.0_23\bin
BUT THE RESULT IS
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\room>javac -version
javac 1.6.0_23
C:\Documents and Settings\room>java -version
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)
my confusion is that
what should i do for getting both versions are same.
priv i downloaded jdk-6u23-windows-i586 from sun microsystems,inc.
it also shows above i given commend promt console pested.
show me how can i run java prog ,
i am using oracle 10g
from 10g can i set path is need for getting java SE output?????????
- 12-26-2010, 11:11 AM #13
Member
- Join Date
- Dec 2010
- Posts
- 8
- Rep Power
- 0
thanku
thanku for your support
After installing jdk1.4.2_03, my java prog are run properly.
I tryied somany times with jdk 1.5,1.6 and also jre6 but my system shows java -version as 1.4.2_03, thats way i compermised and i get 1.4.2_03 and now i am working with java prog's
Thanku for your valuble guidlince
once again
- 12-26-2010, 11:42 AM #14
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 04-18-2011, 10:44 AM #15
Member
- Join Date
- Apr 2011
- Posts
- 1
- Rep Power
- 0
Similar Threads
-
Question about error "Exception in thread "main" java.lang.NoSuchMethodError: main
By ferdzz in forum New To JavaReplies: 5Last Post: 06-22-2010, 03:51 PM -
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/star/lang/XEventLi
By baktha.thalapathy in forum New To JavaReplies: 5Last Post: 06-02-2010, 01:05 PM -
Runtime error "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
By shantimudigonda in forum New To JavaReplies: 1Last Post: 11-20-2009, 07:58 PM -
Exception in thread "main" java.lang.NullPointerException at LinkedList.main(Link
By kavitha_0821 in forum New To JavaReplies: 6Last Post: 07-16-2009, 03:30 PM -
Exception in thread "main" java.lang.NullPointerException at LinkedList.main(Link
By kavitha_0821 in forum New To JavaReplies: 1Last Post: 07-16-2009, 10:35 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks