I am trying to run some java files in a new project. So I make the project, put the files in it and I try to run the main file so my game starts.
I get an error that says selection does not contain a main type
.
I have tried several ways to run it:
Didn't work either.
I am pretty sure it must work because I ran it a few hours ago at school. How do I get this working? Thank you in advance!
Basically, this type of Error means your Editor is not able to find the “main” method in any of your current program classes. The editor shows this error because when you want to run the project, at that time, the interpreter couldn't find the main function to start the execution of the program.
MainType is a powerful but easy to use font manager and font viewer for Windows, that takes the frustration out of managing your fonts. It is packed with tons of intuitive features that makes it simple to find, preview, organize, install, and print your fonts.
public static void main(String[] args) Java main method is the entry point of any java program. Its syntax is always public static void main(String[] args) .
Right click on the folder where you put your main class then click on Build Path
--> Use as Source Folder
.
Finally run your main file as java application. Hope this problem will be solved.
If the option 'Use as Source Folder' is not visible then inside the 'Build Path' select the option 'Remove from Build Path'. This will allow 'Use as Source Folder' option to appear in the 'Build Path'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With