Results 1 to 6 of 6
  1. #1
    Tony Stark is offline Member
    Join Date
    Aug 2016
    Posts
    26
    Rep Power
    0

    Default eclipse problem , running a programme

    i am doing a programme of two classes , but when i click run , it runs only the main class , the problem is when i click run eclipse gives me one class to choose like there is not another one .
    thanks all .
    Tony.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    27

    Default Re: eclipse problem , running a programme

    Does the other class have a main() method?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    Tony Stark is offline Member
    Join Date
    Aug 2016
    Posts
    26
    Rep Power
    0

    Default Re: eclipse problem , running a programme

    yes i have this method in both classes :
    public static void main(String[] args)

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    27

    Default Re: eclipse problem , running a programme

    And what if you right click on the class and select run from the menu?
    I think that's an Eclipse thing...
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    14

    Default Re: eclipse problem , running a programme

    Although permitted, one does not normally have more than one static main entry point. Most classes
    do not have a static main method.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  6. #6
    theunlockeRRR is offline Code Child
    Join Date
    Aug 2016
    Location
    Serbia
    Posts
    45
    Rep Power
    0

    Default Re: eclipse problem , running a programme

    I think that it is best that you make one main class, with main method, then add other classes to that one.
    I have a dream, that one day, I will not rage quit every time I encounter an error I can't fix!

Similar Threads

  1. Problem with running Maven-JSF in Eclipse Kepler
    By gsanchezbiz in forum JavaServer Faces (JSF)
    Replies: 1
    Last Post: 07-21-2014, 11:30 AM
  2. Replies: 5
    Last Post: 05-21-2014, 01:50 PM
  3. Problem When Running Android Application on Eclipse
    By Dark_Brotherhood in forum New To Java
    Replies: 0
    Last Post: 05-20-2014, 03:04 PM
  4. running a java programme on an web server
    By peachy in forum Networking
    Replies: 0
    Last Post: 04-22-2013, 01:21 PM
  5. Problem with running eclipse-jee-helios-win32-x86_64
    By rohit_mali55@yahoo.in in forum Eclipse
    Replies: 2
    Last Post: 09-09-2010, 03:48 PM

Posting Permissions

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