Original Post
Hi, I just made an applet based Asteroids clone, and I am trying to create a jar file. Whenever I click on the jar file (in windows) it gives me a fatal exception occured. I am using this line to create my jar file: jar cvfm Asteroids.jar manifest.txt asteroids/*.class where asteroids is my package, and the directory that contains all the classes. My main class is called Asteroids.class. In the manifest file I have: Main-Class: asteroids.Asteroids including the new line at the end. I'm using eclipse as my ide and the applet runs fine within that. When I try and run the applet within Firefox, the status bar at the bottom says "Loading java applet failed". Checking the java console, I see this: In my html file I have this I've looked around at Sun's website and tried a few different things, but I can't seem to get this to load correctly. I'm sure it's something little I'm forgetting but I'm kind of tired.. All help is greatly appreciated. Thanks [Edited by - caseyd on June 13, 2006 10:04:10 AM]
load: class Asteroids.class not found.
java.lang.ClassNotFoundException: Asteroids.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: C:\Projects\java\Asteroids\Asteroids\class.class (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 10 more
<html>
<head><title></title></head>
<body>
<applet code="Asteroids.class" archive="Asteroids.jar" width="640" height="480"></applet>
</body>
</html>