Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2012
    Posts
    52
    Rep Power
    0

    Default Need help with running programs in eclipse

    I use eclipse and I have made some easy java programs in before. But suddenly when I tried to make one, eclipse gave me the error: "Could not find the main class: LoL. Program will exit". I use JRE 7u3 and JDK 7u3. I do not do anything special I just press the run button in eclipse.

    code I tried:
    Java Code:
    public class LoL {
    	public static void main(String[] args) {
    		System.out.println("hey");
    	}
    
    }
    I would be grateful if someone could answer this, cause without this problem solved I cannot make stuff in java.
    Last edited by HelloWorld1234; 06-12-2012 at 03:27 PM.

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,271
    Rep Power
    25

    Default Re: Need help with running programs in eclipse

    Could not find the main class: test.
    The filename should match the name of the public class in the file. Where is the class named test?


    Have you read this: http://docs.oracle.com/javase/tutori...ava/win32.html
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    Join Date
    Jun 2012
    Posts
    52
    Rep Power
    0

    Default Re: Need help with running programs in eclipse

    sorry, it was supposed to be the same. I fixed it now.
    Last edited by HelloWorld1234; 06-12-2012 at 03:37 PM.

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

    Default Re: Need help with running programs in eclipse

    Learn how define a 'run configuration' for Eclipse; you can run a 'run configuration' instead of just typing F11. You saw what can happen ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    Join Date
    Jun 2012
    Posts
    52
    Rep Power
    0

    Default Re: Need help with running programs in eclipse

    Where can I learn this?

  6. #6
    Join Date
    Jun 2012
    Posts
    52
    Rep Power
    0

    Default Re: Need help with running programs in eclipse

    Thank you Josh! I found out that it was using the JRE 6 (which I didn't have) and I switched it to JRE 7u3 and now it works like a

Similar Threads

  1. Replies: 12
    Last Post: 01-01-2012, 12:28 PM
  2. Running Java programs in windows 7
    By jonytek in forum New To Java
    Replies: 1
    Last Post: 02-09-2011, 04:45 AM
  3. Replies: 6
    Last Post: 04-20-2009, 04:34 AM
  4. Running 3 Java programs in sequence.
    By loktamu in forum New To Java
    Replies: 2
    Last Post: 11-23-2008, 06:50 PM
  5. Problem in running java programs
    By aravind in forum New To Java
    Replies: 0
    Last Post: 07-14-2008, 11:19 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
  •