Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: could not find the main class

  1. #1
    Junior Member
    Join Date
    Aug 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default could not find the main class

    hi everyone
    I have a program written on java, netBeans. I have problem on executing the program. the executable java works with no problem in my computer but when I try to execute the program in diferent computers, it gives the following error. "*could not find the main class. Program will exit" What should I do?

    thanks - berkan


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: could not find the main class

    Make sure all your classes now where each other are. It could also be that you're trying to run a main method in a class that doesn't have one, when you really meant to call another class which does have one. Remember, all Java programs start from the main method (more or less).

Similar Threads

  1. Replies: 5
    Last Post: September 19th, 2009, 06:48 AM
  2. adding main method to a code
    By IDK12 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: August 31st, 2009, 08:52 PM
  3. [SOLVED] find the position of the field separator in the String---need help ASAP
    By rajesh.mv in forum Java Theory & Questions
    Replies: 6
    Last Post: August 17th, 2009, 10:33 AM
  4. Replies: 9
    Last Post: June 27th, 2009, 04:05 PM
  5. [SOLVED] How to a set java class path?
    By captjade in forum Java Theory & Questions
    Replies: 1
    Last Post: March 10th, 2009, 06:40 AM