Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  applet/jar class not found problem  (Read 1262 times)
0 Members and 1 Guest are viewing this topic.
Offline stegzzz

Senior Newbie





« Posted 2011-12-28 12: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

Senior Newbie





« Reply #1 - Posted 2011-12-28 15:31:01 »

OK, sorted, using # in the jar file name was causing the problem.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

BurntPizza (24 views)
2014-09-19 03:14:18

Dwinin (39 views)
2014-09-12 09:08:26

Norakomi (67 views)
2014-09-10 13:57:51

TehJavaDev (93 views)
2014-09-10 06:39:09

Tekkerue (47 views)
2014-09-09 02:24:56

mitcheeb (68 views)
2014-09-08 06:06:29

BurntPizza (51 views)
2014-09-07 01:13:42

Longarmx (38 views)
2014-09-07 01:12:14

Longarmx (44 views)
2014-09-07 01:11:22

Longarmx (40 views)
2014-09-07 01:10:19
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!