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:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01