Results 1 to 6 of 6
  1. #1
    rahul405804 is offline Member
    Join Date
    Apr 2012
    Posts
    14
    Rep Power
    0

    Default Could not Find main class : Eclipse

    When I run the java file which contains the main method, always getting this error message:
    "Could not find the main class. Program will exit.", eventhough there is no error shown by eclipse.
    Can anyone knows the reason for this?

    I tried out "Right click and 'Run As' ", but it gives the same result.

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

    Default Re: Could not Find main class : Eclipse

    Eclipse comes with a huge user nd help manual but sadly enough, almost noone reads it ... Create a 'configuration'. It should be a Java Application configuration; the dialog shows the details you have to fill in, including the class that contains a main( ... ) method. You can also specify the project that class is in and you can name your configuration. You only have to do that once. Finally you can run or debug your configuration.

    Next time, please read the manual before you randomly point and click and hope for the best ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    rahul405804 is offline Member
    Join Date
    Apr 2012
    Posts
    14
    Rep Power
    0

    Default Re: Could not Find main class : Eclipse

    Unfortunately that is not the issue.
    I know how to create projects in eclipse, this is the first time happening like this.
    Restarted eclipse several times, there is no error in programs, deleted the main program and created&checked the program as main class, but still the same problem.
    What can u suggest?

  4. #4
    rahul405804 is offline Member
    Join Date
    Apr 2012
    Posts
    14
    Rep Power
    0

    Default Re: Could not Find main class : Eclipse

    And now the same error is getting for other projects also..
    I'm working on new Eclipse Indigo. Those projects are working fine in eclipse ganymede..

  5. #5
    rahul405804 is offline Member
    Join Date
    Apr 2012
    Posts
    14
    Rep Power
    0

    Default Re: Could not Find main class : Eclipse

    Yes, My project is working fine in Eclipse Ganymede....

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

    Default Re: Could not Find main class : Eclipse

    Moved from New to Java

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Could not find the main class
    By RudeOil in forum New To Java
    Replies: 1
    Last Post: 10-13-2011, 09:37 PM
  2. Could not find or load main class BubbleSort.class
    By blaqkout in forum New To Java
    Replies: 5
    Last Post: 09-12-2011, 07:54 PM
  3. Replies: 0
    Last Post: 06-13-2011, 09:16 PM
  4. Could not find main class
    By Andyj in forum New To Java
    Replies: 2
    Last Post: 10-06-2009, 12:47 AM
  5. JVM Could not find main class
    By banduskank in forum Advanced Java
    Replies: 2
    Last Post: 06-24-2008, 08:05 AM

Tags for this Thread

Posting Permissions

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