Hi, this seems to be a common problem but, despite looking at a lot of examples, I'm still stuck. Any help would be much appreciated.
Whenever I try to run my applet from a web page I keep getting the dreaded error
load: class MainExperiment.class not found.
java.lang.ClassNotFoundException: MainExperiment.class
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.ClassNotFoundException: MainExperiment.class
It runs fine in Eclipse. So I export it to a jar called we#3.jar with the following contents:
META-INF/MANIFEST.MF
.project
.classpath
CSSprite.class
MyAffine.class
NumberKey.class
NameKey.class
Sprite.class
PacMan.class
MainExperiment$CSPosition.class
MainExperiment$ExperimentStatus.class
MainExperiment$HuntingStatus.class
MainExperiment$TrialStatus.class
MainExperiment$dbThread.class
MainExperiment$resourceThread.class
MainExperiment.class
TrialData.class
BlockList.class
ExperimentData.class
TextInfo.class
BufferedImageKey.class
GameCmd.class
MySQLDB.class
TrialList.class
SoundClips.class
USSound.class
IMySQLExperimentDB.class
BlockData.class
MySQLDB1.class
files/spacestation.jpg
In the same directory as the jar file I have my web page which has the applet code:-
<!--"CONVERTED_APPLET"-->
<!-- HTML CONVERTER -->
<object
classid = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
codebase = "
http://java.sun.com/update/1.6.0/jinstall-6u23-windows-i586.cab#Version=6,0,0,5"
WIDTH = "1024" HEIGHT = "768" >
<PARAM NAME = CODE VALUE = "MainExperiment.class" >
<PARAM NAME = ARCHIVE VALUE = "we#3.jar" >
<param name = "type" value = "application/x-java-applet;version=1.6">
<param name = "scriptable" value = "false">
<comment>
<embed
type = "application/x-java-applet;version=1.6" \
CODE = "MainExperiment.class" \
ARCHIVE = "we#3.jar" \
WIDTH = "1024" \
HEIGHT = "768"
scriptable = false
pluginspage = "
http://java.sun.com/products/plugin/index.html#download">
<noembed>
</noembed>
</embed>
</comment>
</object>
<!--
<APPLET CODE = "MainExperiment.class" ARCHIVE = "we#3.jar" WIDTH = "1024" HEIGHT = "768">
</APPLET>
-->
<!--"END_CONVERTED_APPLET"-->
Any suggestions for what I'm doing wrong here? Thanks, stegzzz