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.
Answer from MarsAtomic on Stack OverflowEclipse 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.
Check, 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.
I have been searching everywhere for help on this error, but I cannot figure out how to resolve this issue. From what I've seen on Stack Overflow, I am supposed to click on the Run Configurations link on the drop down menu, but I have no idea what I'm supposed to do once I reach that menu.
Eclipse can't work out what you want to run and since you've not run anything before, it can't try re-running that either.
Instead of clicking the green 'run' button, click the dropdown next to it and chose Run Configurations. On the Android tab, make sure it's set to your project. In the Target tab, set the tick box and options as appropriate to target your device. Then click Run. Keep an eye on your Console tab in Eclipse - that'll let you know what's going on. Once you've got your run configuration set, you can just hit the green 'run' button next time.
Sometimes getting everything to talk to your device can be problematic to begin with. Consider using an AVD (i.e. an emulator) as alternative, at least to begin with if you have problems. You can easily create one from the menu Window -> Android Virtual Device Manager within Eclipse.
To view the progress of your project being installed and started on your device, check the console. It's a panel within Eclipse with the tabs Problems/Javadoc/Declaration/Console/LogCat etc. It may be minimised - check the tray in the bottom right. Or just use Window/Show View/Console from the menu to make it come to the front. There are two consoles, Android and DDMS - there is a dropdown by its icon where you can switch.
Follow these steps to run your application on the device connected.
1. Change directories to the root of your Android project and execute:
ant debug
2. Make sure the Android SDK platform-tools/ directory is included in your PATH environment variable, then execute: adb install bin/<*your app name*>-debug.apk
On your device, locate <*your app name*> and open it.
Refer Running App