Results 1 to 4 of 4
  1. #1
    c0elh0 is offline Member
    Join Date
    Oct 2008
    Location
    Lisbon, Portugal
    Posts
    14
    Rep Power
    0

    Default [SOLVED] calling a .class in a .jar

    Hi all,

    I have this code, and that Manager.class is inside a directory called "classes" and that's inside the scan.jar.

    Java Code:
       <applet code = "Manager.class"
    		codebase = "." 
    		archive = "scan.jar"
    		width = "600" 
    		height = "400">
       	Your browser does not support the <code>applet</code> tag.
    
        	</applet>
    But I keep getting this error in the console saying the Manager.class is not found.

    Java Code:
    load: class Manager.class not found.
    java.lang.ClassNotFoundException: Manager.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)
    Do I need to put the directory name somewhere inside the applet tag?

    Thanks

  2. #2
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    7

    Default

    Pending further work, I am guessing you need to have your Manager class in/on a server. Another issue is that directories are often deliniated by a dot '.' in Java + possibly a classpath issue.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  3. #3
    c0elh0 is offline Member
    Join Date
    Oct 2008
    Location
    Lisbon, Portugal
    Posts
    14
    Rep Power
    0

    Default

    thanks, that was a good hint and I'm now in the next step.

    The problem was I had all classes in a directory not a package!! so I move all classes to the root of the jar and it worked.

    Now I have another problem, I need a 2nd .jar and I placed it inside the 1st. But now console says it can't find files inside the 2nd jar.
    What can I do now?

  4. #4
    c0elh0 is offline Member
    Join Date
    Oct 2008
    Location
    Lisbon, Portugal
    Posts
    14
    Rep Power
    0

    Default

    I got, i just need a separator in the archive field.
    Like this:
    Java Code:
       archive = "scan.jar , xFunction.jar"
    thanks for the help

Similar Threads

  1. Calling a method in another class
    By uncopywritable in forum New To Java
    Replies: 9
    Last Post: 10-22-2012, 04:01 PM
  2. Calling a method on original class from created class
    By kpedersen in forum Advanced Java
    Replies: 4
    Last Post: 08-20-2008, 12:25 AM
  3. Inner Class and Calling Values
    By a45b22chp in forum New To Java
    Replies: 3
    Last Post: 04-25-2008, 08:48 PM
  4. Problem calling another class
    By adlb1300 in forum New To Java
    Replies: 3
    Last Post: 10-25-2007, 02:05 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
  •