Results 1 to 9 of 9
Thread: Chrome/java version difficulties
- 06-01-2012, 08:07 PM #1
Chrome/java version difficulties
Running a HelloWorld applet results in this when opened in Chrome:
So I found out my jdk is 1.7.x and Chrome's java is 1.6.x, so I tried compiling with -source 1.6, got this warning:Java Code:java.lang.UnsupportedClassVersionError: HelloWorld : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(Unknown Source) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source) at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Exception: java.lang.UnsupportedClassVersionError: HelloWorld : Unsupported major.minor version 51.0
Running the newly compiled class, I got same error. I didn't understand the warning, so I wikipedia'd "bootstrap", which didn't help make things any more clear, to be honest. So now I come here. Anybody know what the problem is?Java Code:bootstrap class path not set in conjunction with source 1.6
- 06-01-2012, 08:22 PM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,609
- Rep Power
- 5
Re: Chrome/java version difficulties
Try setting the target version JRE (-target 1.6)
- 06-01-2012, 08:36 PM #3
Re: Chrome/java version difficulties
Thanks for the reply.
Compiler refused, stating:
Java Code:target release 1.6 conflicts with default source release 1.7
- 06-01-2012, 10:06 PM #4
Re: Chrome/java version difficulties
What's the exact compiler command you entered?
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 06-01-2012, 10:34 PM #5
Re: Chrome/java version difficulties
javac *.java -target 1.6
- 06-01-2012, 10:37 PM #6
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,609
- Rep Power
- 5
Re: Chrome/java version difficulties
javac options should precede the compilation source files.
javac -target 1.6 mysourcefile.java
See the help for javac: http://docs.oracle.com/javase/7/docs...ows/javac.html (see the cross-compilation example near the bottom)Last edited by doWhile; 06-01-2012 at 10:39 PM.
- 06-01-2012, 11:03 PM #7
Re: Chrome/java version difficulties
True, but in this case it didn't fix anything.
I've read that a way around this is to completely uninstall 1.7 and install 1.6, instead I'm going to try installing both JDK's and put them both in path.
On a computer with properly updated Chrome, the plugins all work, but I would like to know how to add backward compatibility to my little programs. Do you guys have any tips or resources for that?
- 06-02-2012, 06:28 AM #8
Re: Chrome/java version difficulties
May be related to this bug report: Bug ID: 6856165 tests with explicit -target 1.5 fail with jdk7 since javac now defaults to 1.7
TrydbJava Code:javac -source 1.6 -target 1.6 mysourcefile.java
Why do they call it rush hour when nothing moves? - Robin Williams
- 06-04-2012, 01:21 AM #9
Similar Threads
-
Safari & Chrome Problem - Please Help! New to Java
By azonicds2 in forum New To JavaReplies: 2Last Post: 03-23-2012, 04:06 PM -
Java Applet is not working in Google Chrome
By AsoInfo in forum Java AppletsReplies: 2Last Post: 01-28-2012, 05:56 AM -
IE9 and Chrome
By turboscrew in forum Suggestions & FeedbackReplies: 2Last Post: 05-19-2011, 03:34 PM -
java -version pointing to older version
By deepakts in forum New To JavaReplies: 4Last Post: 05-06-2010, 09:59 AM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks