I want to work on my different class lets say for example house.java but the green play button seems to be locked a program called project.java and only that program. how do I tell Eclipse to run a different classes in the same folder besides the project.java?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
select your class, then select the small triangle right to the green button, in the dropdown select "Run As" -> "Java Application"
回答2:
Apart from ways mentioned in the other answers, you can also try this short key.
Short key : Press ALT + SHIFT + X then J
Hope this helps. :)
回答3:
You can directly left click on your corresponding class code which you want to run and go to run as-->java application.hope this will help. :)
回答4:
First thing to note that class you want to run should have main method in it. right click on that class and run as --> java application. it will run :)
回答5:
main
method is missing in your script:
public static void main(String[] args)