Hello everyone!
I'm developing a
Java applet for the web that I am having trouble deploying using Eclipse.
Info:
It uses an external jar (mysql-connector) in the build path.
The entry class is Main.class (no main method in there, it's just called Main) which is in package userInterfaces
I have tried Export -> JAR File to generate the JAR
I have tried using the open source Fat Jar Exporter to generate the JAR
However, when I try to run the applet within a browser (with the following HTML)
<html>
<title>My Applet</title>
<body>
<applet code="userInterface/Main.class"
archive="newProjectForm_fat.jar"
width=320 height=320>
</applet>
</body>
</html>
It always just shows an error saying that Main.class is not found
java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class userInterface.Main
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class userInterface.Main
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$12.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Any help would be appreciated!
(hopefully I put this in the right place, I figured it's probably something wrong I am doing in eclipse)