Results 1 to 11 of 11
- 04-29-2014, 11:30 AM #1
Member
- Join Date
- Apr 2014
- Posts
- 5
- Rep Power
- 0
Virtual machine launcher : A Java Exception has occured
Hi,
I developped a Java application and it works fine on my computer, but when i tried it on another computers, I have the following errors :
A window named Java Virtual Machine Launcher appears and it says "A Java Exception has occured".
My application don't even launch.
Here is the error lines, but I don't know what to do :
C:\Users\Administrateur_local\serveurtimet>java -jar ServeurTimeT.jar
Exception in thread "main" java.lang.UnsupportedClassVersionError: TimeTracking/
ServeurTimeT : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(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.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 sun.launcher.LauncherHelper.checkAndLoadMain(Unkno wn Source)
Java is up to date.
Please I need help.
- 04-29-2014, 11:38 AM #2
Just a guy
- Join Date
- Jun 2013
- Location
- Netherlands
- Posts
- 5,114
- Rep Power
- 13
Re: Virtual machine launcher : A Java Exception has occured
"Java is up to date" - well one version of Java installed is up to date then, but the version of Java being used to run the application is too old. That's what the "java.lang.UnsupportedClassVersionError" thing means. You can google that and confirm it.
Try executing
java -version
and see what you get."Syntactic sugar causes cancer of the semicolon." -- Alan Perlis
- 04-29-2014, 11:47 AM #3
Member
- Join Date
- Apr 2014
- Posts
- 5
- Rep Power
- 0
Re: Virtual machine launcher : A Java Exception has occured
I tried it and java is 1.8.0_05 on my computer but 1.7.0.55 on the other computer...
The problem is that the computer on 1.7 says the computer has the most recent version of Java...
Both OS are windows 7.
I don't understand
- 04-29-2014, 12:30 PM #4
Just a guy
- Join Date
- Jun 2013
- Location
- Netherlands
- Posts
- 5,114
- Rep Power
- 13
Re: Virtual machine launcher : A Java Exception has occured
The most recent version of Java 7, yes. But you compiled your application for Java 8, a completely different release of Java.
"Syntactic sugar causes cancer of the semicolon." -- Alan Perlis
- 04-29-2014, 12:51 PM #5
Member
- Join Date
- Apr 2014
- Posts
- 5
- Rep Power
- 0
Re: Virtual machine launcher : A Java Exception has occured
I compiled with the default compiler on netbeans. And why does it worked on my computer ?
I changed the Source/Binary format to JDK 7 and it works.
Thanks a lot
- 04-29-2014, 12:54 PM #6
Just a guy
- Join Date
- Jun 2013
- Location
- Netherlands
- Posts
- 5,114
- Rep Power
- 13
Re: Virtual machine launcher : A Java Exception has occured
Because you have Java 8?
I'm starting to feel like captain obvious here."Syntactic sugar causes cancer of the semicolon." -- Alan Perlis
- 04-29-2014, 03:07 PM #7
Senior Member
- Join Date
- Feb 2014
- Posts
- 219
- Rep Power
- 7
Re: Virtual machine launcher : A Java Exception has occured
You can quickly get relevant information by doing an simple Internet search using the search term "UnsupportedClassVersionError." Here's a page that I found that will answer most/all of your questions: How to resolve java.lang.UnsupportedClassVersionError with example
At the moment both Java 7 (1.7) and Java 8 (1.8) have not reached their end of public updates. ("Public update" means updates - bug fixes - to the versions are made available to the public without charge. When a version has reached its end of public update, further updates can only be obtained through paid support.) In your case, the other computer has the latest update for Java 7, which is Java 7 update 55, hence "the most recent version" (of Java 7.)
Quoting from the article I referenced above,
"When JVM tries to load a class and found that class file version is not supported it throws UnSupportedClassVersionError and it generally occurs if a higher JDK version is used to compile the source file and a lower JDK version is used to run the program."
Also,
"But its [sic] important to note is that vice-versa is not true "you can compile your program in J2SE 1.4 and run on J2SE 1.5 and you will not get any UnSupportedClassVersionError"."
In your case a class file compiled using JDK 8, without explicitly changing the binary format to a lower version, will run with Java 8 but not with Java 7. A class file compiled using JDK 8, with the binary format changed to Java 7, will run with both Java 7 and 8.
- 04-29-2014, 03:22 PM #8
Member
- Join Date
- Apr 2014
- Posts
- 5
- Rep Power
- 0
Re: Virtual machine launcher : A Java Exception has occured
Yes I understand, that is logical.
I just understood right now that Java 8 isn't public yet.
I don't have it on the other computer because I haven't IDE for Java installed.
Thank you for your answers.
- 04-29-2014, 03:35 PM #9
Senior Member
- Join Date
- Feb 2014
- Posts
- 447
- Rep Power
- 7
Re: Virtual machine launcher : A Java Exception has occured
So you didn't understand it.
A product can have multiple releases. Just look at Windows. There is WIndows XP, Windows Vista, Windows 7, Windows 8, Windows 8.1, ....
Each version gets updates. So you can check your Windows 7 to see if there are any updates. And it will tell you: There are no updates available.
But that does not mean that your WIndows 7 is the latest major release. And that does not mean that Windows 8 is "not public" or anything like that.
It simply means that you have a different major version!
So an Application that only runs on Windows 8 will not run on Windows 7, Vista or XP.
And it is exactly the same with Java. If you compile something that requires Java 8, then you simply need to have Java 8 on your system. And if the system only has Java 7, then you could simply go and install Java 8, too.
Konrad
- 04-29-2014, 03:48 PM #10
Just a guy
- Join Date
- Jun 2013
- Location
- Netherlands
- Posts
- 5,114
- Rep Power
- 13
Re: Virtual machine launcher : A Java Exception has occured
Pretty sure that if in the original questions "Java" was replaced with "Adobe Flash", all of a sudden things would have been crystal clear even though it is exactly the same situation.
"Syntactic sugar causes cancer of the semicolon." -- Alan Perlis
- 04-29-2014, 06:30 PM #11
Member
- Join Date
- Apr 2014
- Posts
- 5
- Rep Power
- 0
Similar Threads
-
Java Web Start using u45 virtual machine
By dalcorta in forum Java AppletsReplies: 0Last Post: 12-13-2013, 10:30 PM -
Java Virtual Machine Launcher problem
By lamiajoyee in forum New To JavaReplies: 13Last Post: 01-15-2012, 03:35 AM -
Could not create Java Virtual Machine
By cr6 in forum New To JavaReplies: 0Last Post: 02-16-2011, 11:40 PM -
Virtual machine of java.
By Albert in forum Advanced JavaReplies: 1Last Post: 07-05-2007, 09:48 PM -
C# Java Virtual Machine 1.0.1
By levent in forum Java SoftwareReplies: 0Last Post: 05-25-2007, 08:47 AM
Bookmarks