
I have looked everywhere on the internet and tried everything the forums say to do and nothing works. This error keeps coming up. I have tried running my java project (not for android) even the drop down run as button doesn't work because it says "none applicable".
109 Answers
Eclipse needs to see a main method in one of your project's source files in order to determine what kind of project it is so that it can offer the proper run options:
public static void main(String[] args)
Without that method signature (or with a malformed version of that method signature), the Run As menu item will not present any run options.
1Check, you might have written this statement wrong.
public static void main(String Args[])
I have also just started java and was facing the same error and it was occuring as i didn't put []
after args. so check ur statment.
Click on the drop down next to the Run button, After that choose Run Configuration, shows three option, for example i choose java application add class(Name of the class of your project) in that then Click on the ok button ...Run your application :)
Neeraj
When you create a new class file, try to mark the check box near
public static void main(String[] args) {
this will help you to fix the problem.
0click on the project that you want to run on the left side in package explorer and then click the Run button.
1Make sure the "m" in main() is lowercase this would also cause java not to see your main method, I've done that several times unfortunately.
It happens when sometimes we copy or import the project from somewhere. The source folder is a big thing to concern about.
One simple technique is, create a new project, inside the source folder, create a new class and paste the content over there.
It will work...
Hope it helps.
Have you checked if:
class
file under src
folder in your JAVA project?(not file
)I am a newbie who try to run a helloworld example and just got the same error as yours, and these work for me.
0Check if the filename is same as the classname used by your program.
eg.:
class Dfs{ psvm(String[] args){}}
filename should be Dfs.java
ncG1vNJzZmirpJawrLvVnqmfpJ%2Bse6S7zGiorp2jqbawutJoaW5wZW2BcXyOnpqloaCosm62wK%2BYZp2ip7yzedOhoKxlo5q5pq%2FToqanZZOWu6%2B702aZnmWclsKvr8eem2aZnpl6tbTEq5xmmaKaeq%2B7jKucnJ2eqXqtrQ%3D%3D