Eclipse how to run another class

I want to work on my other class, for example, house.java, for example, but the green play button seems to be blocked by project.java and only this program. how can I tell Eclipse to run different classes in the same folder besides project.java?

+2
java eclipse class
source share
5 answers

select your class, then select the small triangle to the right of the green button, select "Run as" → "Java application" in the drop-down list

+2
source share

Besides the methods mentioned in other answers, you can also try this short key.

Shortcut: press ALT + SHIFT + X, then J

Hope this helps. :)

+2
source share

You can immediately click on the corresponding class of code that you want to run and go to execute as a → java application . Hope this helps. :)

+1
source share

First of all, note that the class you want to run must have a main method. right click on this class and run the application -> java. it will work :)

0
source share

main missing script method:

 public static void main(String[] args) 
0
source share

All Articles