Search code examples
javaapachedeploymentappletclassnotfoundexception

Deploy Applet on Apache server


I've written a Java applet game that I want to deploy on my Apache server. Code + resources are in a self signed .jar with accompanying HTML doc both in the root dir. When I run it on my local machine everything works fine. When I try to run on the server I get a class not found exception. index.html contains

<applet code=SpaceRaiderz.class  
 archive=spaceraiderz.jar  
 width=1024 height=768>  
</applet>

The class not found is the class named above. Opened up the .jar and its contents are complete. File permissions set to 755. If I click the index.html on my local machine it loads up and runs perfectly. Ftp the same docs to the server and it doesn't work. Anyone had this problem? I found a similar question to this on here but none of the suggested solutions have worked in this case.


Solution

  • The applet (seen here) works (e.g. showing an asteroids style game featuring a pale green ship that appears suspiciously familiar + sound track) for me in Java 1.7.0_21 on Windows using FF. Refreshing the class cache in the console & then refresh the page might fix the problem for you.

    If that fails, there are still more options for testing the applet:

    • Usually installing another browser (these things are often due to a problem in the particular browser/JRE combo.).
    • There is also the Appleteer applet testing environment. I can highly recommend it, Since I wrote it.
    • Go to an internet cafe or the local library to check an applet, if all else fails.