在Android的Studio中运行Java应用程序 [英] Running Java application in Android Studio

查看:462
本文介绍了在Android的Studio中运行Java应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创造了新的libgdx的项目,我想在运行Android的工作室的桌面应用程序。有没有事做的运行配置?在Eclipse中我可以选择运行的Java应用程序。

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.

推荐答案

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

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

运行 - >编辑配置... ,点击加号( + )按钮,然后选择应用程序。将名称设置为桌面。设置字段使用模块的类路径桌面,然后点击主要的按钮类字段,然后选择 DesktopLauncher 类。将工作目录安卓/资产/ (或 your_project_path /核心/资产/ )的文件夹!点击应用然后确定。现在,您已经创建了您的桌面项目运行配置。现在,您可以选择配置并运行它。

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.

这篇关于在Android的Studio中运行Java应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆