在Android Studio中运行Java应用程序

nik*_*ter 9 java android libgdx android-studio

我创建了新的libgdx项目,我想在Android Studio中运行桌面应用程序.是否与运行配置有关?在Eclipse中,我可以选择Run as Java Application.

nik*_*ter 10

好的,我做到了.这是解决方案https://github.com/libgdx/libgdx/wiki/Gradle-and-Intellij-IDEA#running-your-project

Run -> Edit Configurations...,单击加号(+)按钮,然后选择"应用程序".

将名称设置为Desktop.

将字段设置Use classpath of moduledesktop,然后单击该Main class字段的按钮并选择DesktopLauncher该类.

设置Working directory为您的android/assets/(或your_project_path/core/assets/)文件夹!

单击Apply然后OK.

您现在已经为桌面项目创建了运行配置.您现在可以选择配置并运行它.