Running Java application in Android Studio

假装没事ソ 提交于 2019-11-29 09:47:56

问题


I created new libgdx project and i want to run desktop application in Android Studio. Is there something to do with run configurations? In Eclipse i can just choose Run as Java Application.


回答1:


Ok, i did it. Here is the solution https://github.com/libgdx/libgdx/wiki/Gradle-and-Intellij-IDEA#running-your-project

Run -> Edit Configurations..., click the plus (+) button and select Application.

Set the Name to Desktop.

Set the field Use classpath of module to desktop, then click on the button of the Main class field and select the DesktopLauncher class.

Set the Working directory to your android/assets/ (or your_project_path/core/assets/) folder!

Click Apply and then OK.

You have now created a run configuration for your desktop project. You can now select the configuration and run it.




回答2:


Right click on the main method (or anywhere in the main class) and select Run.



来源:https://stackoverflow.com/questions/27765834/running-java-application-in-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!