Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  applet/jar class not found problem  (Read 192 times)
0 Members and 2 Guests are viewing this topic.
Offline stegzzz

JGO n00b
*

Posts: 12



« on: 2011-12-28 07:34:04 »

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
Offline stegzzz

JGO n00b
*

Posts: 12



« Reply #1 on: 2011-12-28 10:31:01 »

OK, sorted, using # in the jar file name was causing the problem.
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.076 seconds with 19 queries.