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

    Default Could Not Find Main Class (AGAIN!)

    Could Not Find Main Class (again)
    This was my old thread, this time I speak on behalf of someone else with whom I am trying to fix his computer.

    Again:

    i did some searching around this site and on google and such and after about a month i have decided to make an account for the sole purpose of asking this question.
    To be clear: I DO NOT SPEAK JAVA
    The Problem: After recently updating Java to the latest version (21) I now get the following error running any .jar file. "Could Not Find The Main Class: *****/**/***.jar Program Will Exit." ** are examples.
    What I have tried:
    Using msciuu2.exe to Completely uninstall Java and Remove its Registry Components
    Reinstalling Java
    Running it from the command line using java -jar JARFILE.jar

    Rizon Web IRC (qwebirc)
    How the hell do i fix this,
    Some More info: I realize this error means that there is no claspath from the Manifest File, all of the jar files I have tried are working fine on everyone elses computer and there is no reason they shouldnt work for mine, after investigating the manifest file it is the same as a working version.

    Example 1
    Example 2
    Ideas?

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

    Default

    This is not a bump.

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default

    Why the chat site link in the OP? Spam reported.

    db

  5. #5
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,558
    Rep Power
    23

    Default

    Running it from the command line using java -jar JARFILE.jar
    Can you open a command prompt window, enter the above java command and then copy the full contents of the command prompt window and paste it here?

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

    Default

    Hi, im the person he's helping. i got


    I hope it helps

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

    Default

    Quote Originally Posted by Darryl.Burke View Post
    Why the chat site link in the OP? Spam reported.

    db
    how is it spam? its how/where to reach him if you need to discuss something...

  8. #8
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    12,999
    Blog Entries
    7
    Rep Power
    19

    Default

    Quote Originally Posted by Havefunpeeps View Post
    Hi, im the person he's helping. i got


    I hope it helps
    It's "java -jar ..."; not "java jar ..." (you forgot a minus sign as the first character of a flag).

    kind regards,

    Jos

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

    Default



    Sorry im a total java noob...

  10. #10
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,558
    Rep Power
    23

    Default

    im a total java noob
    Not just for java. Do you know how to find files on your PC?
    Where is the RSBot.jar file located? You need to be in that folder when you execute the command.

    To copy the contents of the command prompt window:
    Click on Icon in upper left corner
    Select Edit
    Select 'Select All' - The selection will show
    Click in upper left again
    Select Edit and click 'Copy'

    Paste here.

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

    Default

    its located on the desktop.

  12. #12
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,558
    Rep Power
    23

    Default

    Can you show that by using the dir command to show what files are in the folder before you try to execute the java -jar command? Copy all of the screen and paste it here.

  13. #13
    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\*********>cd desktop

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

    Directory of C:\Documents and Settings\**** *******\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,459,840 bytes free

    C:\Documents and Settings\********\Desktop>java -jar RSbot.jar

    C:\Documents and Settings\********\Desktop>



    thats what shows up. after i type the java -jar RSbot.jar, the error "Could not find main class: org.rsbot.Application. Program will exit."
    Last edited by Havefunpeeps; 10-02-2010 at 05:26 PM.

  14. #14
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    12,999
    Blog Entries
    7
    Rep Power
    19

    Default

    Go to the directory where the .jar file is stored and type:

    Java Code:
    java -jar .\RSBot.jar
    kind regards,

    Jos

    edit: note the case for every letter in your file RSBot.jar ...
    Last edited by JosAH; 10-02-2010 at 06:05 PM.

  15. #15
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,558
    Rep Power
    23

    Default

    thats what shows up
    It would be better if you would copy all of the command prompt window showing exactly was entered and what the response was. Your editing it could omit something important.

    That is a different error message than the one in the image. Now the java command has found and is reading the jar file.
    Who built the jar file? Can you ask them where the following class file is located:
    org.rsbot.Application

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

    Default

    josAH: this is what i get:
    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>java -jar.\RSBot.jar
    Unrecognized option: -jar.\RSBot.jar
    Could not create the Java virtual machine.

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



    Without edits: 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,623,680 bytes free

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

    C:\Documents and Settings\Eric Hamilton\Desktop>
    i only edited out my name.

  17. #17
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    12,999
    Blog Entries
    7
    Rep Power
    19

    Default

    Quote Originally Posted by Havefunpeeps View Post
    C:\Documents and Settings\Eric Hamilton\Desktop>java -jar.\RSBot.jar
    Unrecognized option: -jar.\RSBot.jar
    That is -jar <space> <dot> <backslash> RSBot.jar; you forgot a space character. Be secure.

    kind regards,

    Jos

  18. #18
    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 .\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>

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

    Default

    Ok, Norm: as i stated in the OP,
    "What I have tried:
    ...
    Running it from the command line using java -jar JARFILE.jar"

    Usually that fixed the problem, however in this case, it still shows the same error from "java virtual machine luancher" Could Not Find Main Class.

  20. #20
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,558
    Rep Power
    23

    Default

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

    C:\Documents and Settings\Eric Hamilton\Desktop>
    From post#17.
    This does NOT show any errors!!!
    Then it must have worked!

Page 1 of 3 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
  •