Hi everyone, I know my code works when I run it in eclipse but it does not load in my browser. I have tried my best to find similar posts but none of the solutions helped me fix my problem.
I have Java Plug-in 1.6.0_31 for my Chrome / Firefox browser
I may have messed up the path trying to debug this problem.... but my current path is this:
C:\WINDOWS\system32;C:\Program Files\Java\jdk1.7.0_03\bin
I have jdk1.7.0_03, jdk1.7.0, and jdk1.6.0_31 installed, I have different ones because I tried to debug the problem myself...
In my Eclipse compiler I have tried editing the options: Window->Preferences->Java->Compiler and I have tried to compile my code as 1.7, 1.6.. etc. At the same time I would change the selected JRE used again trying to debug this problem... Window->Preferences->Java->Installed JREs.
this is my current Java code, I have tried other code samples as well, but this should work just as well...
import javax.swing.JApplet; import java.awt.*; public class Test extends JApplet { public void paint(Graphics gfx) { gfx.drawString("HELLO THERE", 100, 100); } }
Here's my HTML code, I've tried changing it several times also as other sources I have looked up suggested. But here is the simplest one:
<applet code="Test" width=1000 height=550> </applet>
The error I recieve when trying to load my applet in a browser is this:
basic: Added progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@125e2eb basic: error: Test : Unsupported major.minor version 51.0. java.lang.UnsupportedClassVersionError: Test : 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: Test : Unsupported major.minor version 51.0
I've tried to debug this myself and have failed.... I tried looking up the error and from what I read, I thought maybe it was because I was trying to use 1.y java to read 1.x compiled code.
If anyone can help me with this problem I would greatly appreciate it and if more information is needed I'll gladly give it.