Results 1 to 3 of 3
  1. #1
    edpfister is offline Member
    Join Date
    Mar 2009
    Posts
    2
    Rep Power
    0

    Default Problems getting jar file running locally

    Hello,

    There is an applet I found on the web that I want to get running locally on my PC. It allows you to play old text adventures such as Zork in a browser and is called Zplet. I downloaded the jar file from the source (it won't let me post the link but I got it from sourceforge.net) so the code should not be the problem. Here are the main things I have tried to get this running.

    1) Copied the source html code (see below) from a website that has Zplet running and modified the names to match what I am using. Put that in the same folder as the Zplet.jar file along with the story file (the game file). Doing this I get an exception as detailed below.

    -----HTML-----
    <title>Zplet: PLANETFALL: INTERLOGIC Science Fiction</title>
    <hr>
    <applet code="Zplet.class" archive="Zplet.jar" width=512 height=387>
    <param name="Foreground" value="white">
    <param name="Background" value="black">
    <param name="StatusForeground" value="black">
    <param name="StatusBackground" value="white">
    <param name="StoryFile" value="planetfall.z3">
    </applet>
    <hr>
    Please note that SAVE and RESTORE may not available due to
    applet security restrictions. Leaving this page may or may
    not restart the game depending on the behavior of your browser.

    -----RESULT-----
    load: class Zplet.class not found.
    java.lang.ClassNotFoundException: Zplet.class
    ...
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.FileNotFoundException: C:\Documents and Settings\Development\Desktop\Java Test\Zplet\Zplet\class.class (The system cannot find the file specified)
    ...
    Exception: java.lang.ClassNotFoundException: Zplet.class

    I opened the jar file and verified that there is a class named Zplet.class inside (and case is the same as well). The code is a bit complicated though with many folders so the class is not in the root. It is in russotto\zplet. Do I somehow need to tell it about this path or can java search through the jar file for it? If I need to specify the location inside the jar how do you do that exactly?

    2) I also tried to uncompress the jar file and tried working with the Zplet.class directly. I placed the html file in the same location as the class and modified it by removing the archive section. In this case I get a different error as seen below.

    -----RESULT-----
    java.lang.NoClassDefFoundError: Zplet (wrong name: russotto/zplet/Zplet)
    ...
    Exception: java.lang.NoClassDefFoundError: Zplet (wrong name: russotto/zplet/Zplet)

    I'm not sure what this means exactly but by the fact that it has russotto/zplet in there I'm guessing the code has this path hard coded in it.

    Any clue what I'm doing wrong? It seems to be a problem with paths or something but I don't have the experience to figure this out. Can anyone help? I have virtually no experience with applets so please be gentle.

    Oh and I'm using Windows XP, IE 7.0 and the latest JRE if that matters.
    Last edited by edpfister; 03-07-2009 at 01:22 AM.

  2. #2
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    The value for code should include the package name. In this case it would be code=russotto.zplet.Zplet

  3. #3
    edpfister is offline Member
    Join Date
    Mar 2009
    Posts
    2
    Rep Power
    0

    Default

    Thanks, the java code is now loading. Unfortunately the browers is just bringing up a blank form and not loading the story for some reason but that's a different issue probably related to the applet itself. Thanks again.

Similar Threads

  1. Replies: 2
    Last Post: 03-20-2009, 11:58 AM
  2. Not able to generate excel file locally
    By wickedrahul9 in forum Advanced Java
    Replies: 4
    Last Post: 10-23-2008, 12:17 PM
  3. Problems running subreports with JasperReport
    By jiggaworld in forum Advanced Java
    Replies: 0
    Last Post: 10-15-2008, 11:14 AM
  4. Equinox problems running on Eclipse 3.4
    By jguerra in forum Eclipse
    Replies: 0
    Last Post: 09-05-2008, 03:34 PM
  5. Problems in running client class
    By ai_2007 in forum Advanced Java
    Replies: 0
    Last Post: 06-30-2007, 03:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •