I have made test.jar file and Applet1.html file both are placed on a web server. test.jar runs perfectly by itself on my local computer but when placed on the server it does not run at all and the following error comes up:
Application Error
RuntimeException
java.lang.reflect.InvocationTargetException
HTML to call the test.jar
<applet
code="MainClass.class"
width="400" height="400"
archive="test.jar"
alt="Error Loading Applet?!" >
</applet>
Very basic applet (hello world) works fine but when I make a .jar out of it it does not work.
This link has the two files used:
Could someone help me solve this?
The
MainClasswhich runs so well at home is not an applet. Double clicking the Jar launches a frame titled “Java Game”.Launch the frame directly from a link using Java Web Start.