Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 55
  1. #21
    illjavathat is offline Member
    Join Date
    Jun 2010
    Posts
    29
    Rep Power
    0

    Default

    Norm: thats what i meant when i said this is the usual fix, however for some reason it still errors out. as the screenshot in the OP.

    I am very confused.

  2. #22
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,562
    Rep Power
    25

    Default

    it still errors out
    Without showing me the contents of the screen (copied text not image) I don't know what error you are getting. So far you have shown two different errors.

  3. #23
    illjavathat is offline Member
    Join Date
    Jun 2010
    Posts
    29
    Rep Power
    0

    Default

    Norm: quite confused as i said before, the contents of what screen? the screenshots in the OP are the only errors that come up, what do you mean by two different errors?

  4. #24
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,655
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by Havefunpeeps View Post
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    C:\Documents and Settings\Eric Hamilton>cd desktop

    C:\Documents and Settings\Eric Hamilton\Desktop>-jar .\RSBot.jar
    '-jar' is not recognized as an internal or external command,
    operable program or batch file.

    C:\Documents and Settings\Eric Hamilton\Desktop>-jar .\RSBot.jar
    '-jar' is not recognized as an internal or external command,
    operable program or batch file.

    C:\Documents and Settings\Eric Hamilton\Desktop>
    Jeez, I'd thought you'd understand: as I wrote in my reply #15, it's

    Java Code:
    java -jar .\RSBot.jar
    pay close attention to the case of all letters and don't forget any spaces ...

    kind regards,

    Jos
    Last edited by JosAH; 10-02-2010 at 07:02 PM.

  5. #25
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,562
    Rep Power
    25

    Default

    Ok forget about what has been posted up to now.
    We need to start from the beginning.
    Open a command prompt, issue the command, copy the full text and post it here. No images because you can NOT copy and paste text from images.
    Without the current status of the problem, we're running in circles.

  6. #26
    illjavathat is offline Member
    Join Date
    Jun 2010
    Posts
    29
    Rep Power
    0

    Default

    Josah: can you explain what the difference of "java -jar RSBot.jar" and "java -jar .\RSBot.jar" is?

  7. #27
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,655
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by illjavathat View Post
    Josah: can you explain what the difference of "java -jar RSBot.jar" and "java -jar .\RSBot.jar" is?
    Nothing really but I wanted to make sure you were in the correct directory; but until now it seems that I have to spell it out verbatim because everything still is misunderstood (or not undertood at all) or not read correctly or sloppily copied ...

    kind regards,

    Jos

  8. #28
    illjavathat is offline Member
    Join Date
    Jun 2010
    Posts
    29
    Rep Power
    0

    Default

    Norm: while this isn't my problem its for havefunpeeps and another, this is what the text is, as quoted in your reply 21.

    Java Code:
    C:\Documents and Settings\Eric Hamilton\Desktop>java -jar RSBot.jar
    
    C:\Documents and Settings\Eric Hamilton\Desktop>
    From this i would gather that it worked, and usually in this case it would, however it is at this time the dialogue box posted in #1 appears, and the actual jar file is not run.

  9. #29
    illjavathat is offline Member
    Join Date
    Jun 2010
    Posts
    29
    Rep Power
    0

    Default

    Josah: kk i understand, but yes we tried this and there was no luck, "unable to access jarfile" would appear if in the wrong directory i believe,

    Btw if any of you are on atm,
    Rizon Web IRC (qwebirc)

  10. #30
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,655
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by illjavathat View Post
    Norm: while this isn't my problem its for havefunpeeps and another, this is what the text is, as quoted in your reply 21.

    Java Code:
    C:\Documents and Settings\Eric Hamilton\Desktop>java -jar RSBot.jar
    
    C:\Documents and Settings\Eric Hamilton\Desktop>
    From this i would gather that it worked, and usually in this case it would, however it is at this time the dialogue box posted in #1 appears, and the actual jar file is not run.
    If you don't get any errors your jar file has run correctly. If you don't see any output (nor any window or whatever trace that your class has run correctly), probably your main( ... ) method needs at least one argument on the command line? We can only guess because you don't star in giving us an abundance of information.

    kind regards,

    Jos

  11. #31
    Havefunpeeps is offline Member
    Join Date
    Oct 2010
    Posts
    13
    Rep Power
    0

    Default

    @Norm: Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    C:\Documents and Settings\Eric Hamilton>cd desktop

    C:\Documents and Settings\Eric Hamilton\Desktop>dir
    Volume in drive C is TI104522P0B
    Volume Serial Number is 502C-AE60

    Directory of C:\Documents and Settings\Eric Hamilton\Desktop

    10/02/2010 11:11 AM <DIR> .
    10/02/2010 11:11 AM <DIR> ..
    06/06/2010 09:09 PM <DIR> Applications i really dont use alot
    10/01/2010 11:46 PM 1,036 Dropbox.lnk
    09/22/2010 09:16 PM 2,362 Google Chrome.lnk
    10/03/2009 11:43 PM 51,200 GridClicker.exe
    04/01/2010 10:23 AM 629 HyperCam 2.lnk
    09/15/2010 09:03 PM 3,148,854 Mario!.bmp
    09/27/2010 07:03 PM 2,497 Microsoft Office Word 2003.lnk
    08/23/2010 08:03 PM 359,656 msicuu2.exe
    09/14/2010 04:23 PM <DIR> Notepads
    09/30/2010 06:52 PM 14,605 PiBeRational-tee.gif
    09/15/2010 04:14 PM <DIR> PP Mods (new)
    09/15/2010 04:14 PM <DIR> PP Mods (orig)
    09/26/2010 08:35 PM <DIR> PP screenies
    11/14/2009 01:51 PM 1,680 Puzzle Pirates.lnk
    01/11/2010 07:20 PM 506,368 QMDamageCounter.exe
    09/11/2010 04:38 PM 2,299 QuarterMaster.lnk
    09/18/2010 06:31 PM 104 Recycle Bin.lnk
    10/02/2010 11:11 AM 1,370,445 RSBot.jar
    07/11/2010 11:56 AM 2,265 Skype.lnk
    06/04/2010 02:00 PM <DIR> Unused Desktop Shortcuts
    08/22/2010 04:45 PM 1,686 Yohoho Tools.lnk
    09/23/2010 04:47 PM <DIR> Youtube Videos
    15 File(s) 5,465,686 bytes
    9 Dir(s) 230,455,148,544 bytes free

    C:\Documents and Settings\Eric Hamilton\Desktop>java -jar RSBot.jar

    C:\Documents and Settings\Eric Hamilton\Desktop>

    Then i get a pop-up box that says Could not find the main class: org.rsbot.Application. Program will exit.

  12. #32
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,655
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by Havefunpeeps View Post
    Then i get a pop-up box that says Could not find the main class: org.rsbot.Application. Program will exit.
    Check if that class is stored in your .jar file; do this and check the list:

    Java Code:
    jar tvf RSBot.jar
    kind regards,

    Jos
    Last edited by JosAH; 10-02-2010 at 07:29 PM.

  13. #33
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,562
    Rep Power
    25

    Default

    Sorry, I can not get the dialogue box posted in #1 using the java command. I only get it using the javaw command. Here's what I get with the java command:
    Java Code:
    D:\JavaDevelopment\Testing\ForumQuestions3\TestingFile>java -jar Test2.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: CopyFilesFromJarXX
    Caused by: java.lang.ClassNotFoundException: CopyFilesFromJarXX
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
    Could not find the main class: CopyFilesFromJarXX. Program will exit.
    
    D:\JavaDevelopment\Testing\ForumQuestions3\TestingFile>
    I modified the manifest to reference a non-existent class file:
    Manifest-Version: 1.0
    Created-By: 1.5.0_04 (Sun Microsystems Inc.)
    Main-Class: CopyFilesFromJarXX


    I'm not able to get your error so I guess your on your own now. Good luck.
    Last edited by Norm; 10-02-2010 at 07:27 PM.

  14. #34
    Havefunpeeps is offline Member
    Join Date
    Oct 2010
    Posts
    13
    Rep Power
    0

    Default

    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    C:\Documents and Settings\Eric Hamilton>cd desktop

    C:\Documents and Settings\Eric Hamilton\Desktop>jar -t -v -f RSBot.jar
    'jar' is not recognized as an internal or external command,
    operable program or batch file.

    C:\Documents and Settings\Eric Hamilton\Desktop>java jar -t -v -f RSBot.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: jar
    Caused by: java.lang.ClassNotFoundException: jar
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    Could not find the main class: jar. Program will exit.

    C:\Documents and Settings\Eric Hamilton\Desktop>

    So does this mean the main class isnt in the .jar file?

  15. #35
    illjavathat is offline Member
    Join Date
    Jun 2010
    Posts
    29
    Rep Power
    0

    Default

    Josah: this is for any jar file, not a specific one and i know that this specific jarfile used in example 1 is valid. and works for me.

    Norm: The association for this specific jar file (RSBot) is with javaw.exe but when running from the command line i still used java -jar rsbot.jar i didnt realize that javaw would make a difference, should i be doing that differently?

  16. #36
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,655
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by Havefunpeeps View Post
    So does this mean the main class isnt in the .jar file?
    No, read what was written: it means that you didn't type in correctly what I told you to do. You do have a jdk installed do you? If not try to use winzip or equivalent to inspect your .jar file ...

    kind regards,

    Jos

  17. #37
    illjavathat is offline Member
    Join Date
    Jun 2010
    Posts
    29
    Rep Power
    0

    Default

    Havefunpeeps: open rsbot.jar with WinRar and you will see the main in org.rsbot.applicatoin.class (from the manifest file)

    Josah: I know, this essentialy is the problem, he does have JDK installed but the registry associations are not correct.

  18. #38
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,655
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by illjavathat View Post
    Josah: I know, this essentialy is the problem, he does have JDK installed but the registry associations are not correct.
    Well, all bets are off then; uninstall and install the entire jdk and try again; working with defect tools is never going to work ...

    kind regards,

    Jos

  19. #39
    illjavathat is offline Member
    Join Date
    Jun 2010
    Posts
    29
    Rep Power
    0

    Default

    Josah: see the OP, i already tried this, including deleting all registry values and complete uninstall with an uninstall tool, and then reinstalling.

  20. #40
    illjavathat is offline Member
    Join Date
    Jun 2010
    Posts
    29
    Rep Power
    0

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Could Not Find Main Class (again)
    By illjavathat in forum New To Java
    Replies: 25
    Last Post: 11-23-2010, 09:49 AM
  2. could not find main class?
    By deathnote202 in forum New To Java
    Replies: 6
    Last Post: 05-10-2010, 08:57 PM
  3. Could not find main class
    By Andyj in forum New To Java
    Replies: 2
    Last Post: 10-06-2009, 12:47 AM
  4. Could not find main class - JDK 1.6
    By Syranno in forum New To Java
    Replies: 1
    Last Post: 07-25-2008, 04:07 PM
  5. JVM Could not find main class
    By banduskank in forum Advanced Java
    Replies: 2
    Last Post: 06-24-2008, 08:05 AM

Posting Permissions

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