Inside Eclipse Android project run Java classes with main()

In case of an Android project, you have to remove Android Lib from the launch configuration for that specific class. Use the "walkthrough" below as a guide.

  • Project->Properties->Run/Debug Settings;
  • Select your Class and click "Edit";
  • Open the tab "Classpath" and remove Android Lib from "Bootstrap Entries";
  • Apply everything and Run the class again.

OR

You can get past this by using the Run As -> Android Application. Possibly check the Run configuration for other issues.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326530137&siteId=291194637
Recommended