libgdx ClassNotFoundException when starting Desktop main - Mac, IntelliJ(启动桌面主时的 libgdx ClassNotFoundException - Mac,IntelliJ)
问题描述
我按照 IntelliJ 设置教程中的说明设置我的项目,但是我无法启动桌面应用程序.android 应用程序在模拟器和我的 S3 上都可以正常启动,但桌面中的 main 无法找到我的类..
I set up my project as described in the IntelliJ setup tutorial, but I am unable to start the Desktop application. The android app starts up fine in both the emulator and on my S3, but main in Desktop is unable to find my class..
日志:
Exception in thread "main" java.lang.ClassNotFoundException: com.xxx.xxx.xxx.DesktopStarter
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:171)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:113)
我正在运行 Mac OSX 10.7.5、Apple 的 Java JDK 1.6.0_43 和 IntelliJ 12.0.4.我觉得这很简单,我似乎无法找到问题所在.(别笑我的班级名字,这是给我4岁的女儿);D
I am running Mac OSX 10.7.5, Apple's Java JDK 1.6.0_43, and IntelliJ 12.0.4. I feel like it is something dead simple, I just can't seem to find the issue. (Don't laugh at my class name, it's for my 4yr old daughter) ;D
推荐答案
LibGDX 1.7.1、IntelliJ IDEA 15.0、Windows 8.1 -- 我一直在尝试通过 IDE 的运行配置对话框运行 DesktopLauncher 时遇到问题.
LibGDX 1.7.1, IntelliJ IDEA 15.0, Windows 8.1 -- I kept getting the problem trying to run DesktopLauncher through the IDE's Run Configurations dialogs.
相反,运行 Gradle 任务(桌面 -> 运行)可以完美运行.
Instead, running the Gradle task (desktop -> run) works perfectly.
要在 IntelliJ 中运行 Gradle 任务,
To run the Gradle task within IntelliJ,
- 按 Shift 两次,输入Gradle"以打开 Gradle 项目窗格
- 如果没有显示任何内容,请点击刷新所有 Gradle 项目"按钮
- 展开:桌面>任务>其他
- 双击运行"
- Hit Shift twice, type "Gradle" to open the Gradle projects pane
- Hit the "Refresh all Gradle projects" button if nothing is showing up
- Expand :desktop > Tasks > other
- Double-click "run"
这篇关于启动桌面主时的 libgdx ClassNotFoundException - Mac,IntelliJ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:启动桌面主时的 libgdx ClassNotFoundException - Mac,I


- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01