Page 2 of 2 FirstFirst 12
Results 21 to 27 of 27
  1. #21
    TaintedMike is offline Member
    Join Date
    Jan 2012
    Posts
    8
    Rep Power
    0

  2. #22
    Join Date
    May 2011
    Location
    Seattle, WA
    Posts
    35
    Rep Power
    0

    Default Re: Extreme frustration with JAR files

    That I'm not lacking any vital ones?
    I have all the imports required.

  3. #23
    TaintedMike is offline Member
    Join Date
    Jan 2012
    Posts
    8
    Rep Power
    0

    Default Re: Extreme frustration with JAR files

    Are you using a ide to check?
    And have you tried not making a package but a simple print string and tested that in a html?

  4. #24
    Join Date
    May 2011
    Location
    Seattle, WA
    Posts
    35
    Rep Power
    0

    Default Re: Extreme frustration with JAR files

    Yes, I'm using Eclipse.
    I haven't made one of those, could you explain how?

  5. #25
    TaintedMike is offline Member
    Join Date
    Jan 2012
    Posts
    8
    Rep Power
    0

    Default Re: Extreme frustration with JAR files

    Java Code:
    import java.awt.*;
    import java.applet.*;
    
    public class SimpleApplet extends Applet {
    
    public void paint (Graphics g) {
    
    g.drawString("First Applet", 50, 50 );
    
    }
    
    }
    Give it a try

  6. #26
    Join Date
    May 2011
    Location
    Seattle, WA
    Posts
    35
    Rep Power
    0

    Default Re: Extreme frustration with JAR files

    Quote Originally Posted by TaintedMike View Post
    Java Code:
    import java.awt.*;
    import java.applet.*;
    
    public class SimpleApplet extends Applet {
    
    public void paint (Graphics g) {
    
    g.drawString("First Applet", 50, 50 );
    
    }
    
    }
    Oh, you mean that.
    I really misunderstood you there XD

    Here is a link to the .zip file I made of it

    Here is the source:
    Java Code:
    package simplePack;
    
    import java.awt.*;
    import java.applet.*;
     
    public class SimpleApplet extends Applet {
     
    public void paint (Graphics g) {
     
    g.drawString("First Applet", 50, 50 );
     
    }
     
    }
    And of course I can't run the Executable JAR...
    I have to get off for now, bye.

  7. #27
    Join Date
    May 2011
    Location
    Seattle, WA
    Posts
    35
    Rep Power
    0

    Default Re: Extreme frustration with JAR files

    Okay guys, so I've made some progress.

    I was able to compile the simple applet TaintedMike gave me to a normal JAR and put it on my webpage.
    It runs fine.

    However, when trying to embed my game (I'm extending to Applet and everything, that part works fine) I get the following error:
    load: class testPack/Test.class not found.
    java.lang.ClassNotFoundException: testPack.Test.class
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Un known Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(U nknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Un known Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Un known Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unk nown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unk nown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionR unnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Exception: java.lang.ClassNotFoundException: testPack.Test.class
    load: class testPack/Test.class not found.
    java.lang.ClassNotFoundException: testPack.Test.class
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Un known Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(U nknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Un known Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Un known Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unk nown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unk nown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionR unnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Exception: java.lang.ClassNotFoundException: testPack.Test.class
    load: class testPack/Test.class not found.
    java.lang.ClassNotFoundException: testPack.Test.class
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Un known Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(U nknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Un known Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Un known Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unk nown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unk nown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionR unnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Exception: java.lang.ClassNotFoundException: testPack.Test.class
    java.lang.reflect.InvocationTargetException
    at com.sun.deploy.util.DeployAWTUtil.invokeAndWait(Un known Source)
    at sun.plugin2.applet.Plugin2Manager.runOnEDT(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unk nown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionR unnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.ClassCastException: testPack.Test cannot be cast to java.applet.Applet
    at sun.plugin2.applet.Plugin2Manager$12.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$000(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectio nPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilter s(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Exception: java.lang.reflect.InvocationTargetException
    I'm confident the reason is that I'm using multiple classes.
    The .zip of the JAR file
    Last edited by meesterpickles; 01-31-2012 at 03:22 AM.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 11
    Last Post: 12-04-2011, 11:10 PM
  2. Replies: 2
    Last Post: 06-11-2011, 02:54 PM
  3. Creating Jar Files with functioning input files
    By appleLove in forum NetBeans
    Replies: 1
    Last Post: 04-10-2011, 11:37 PM
  4. Replies: 8
    Last Post: 07-30-2010, 06:47 PM
  5. Extreme nooby having hard time with this app
    By asterix350z in forum New To Java
    Replies: 2
    Last Post: 12-05-2007, 08:24 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
  •