启动Desktop main时出现libgdx ClassNotFoundException-Mac,IntelliJ [英] libgdx ClassNotFoundException when starting Desktop main - Mac, IntelliJ

查看:109
本文介绍了启动Desktop main时出现libgdx ClassNotFoundException-Mac,IntelliJ的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照 IntelliJ设置教程中的说明设置了项目,但是我无法启动桌面应用程序. android应用程序可以在模拟器和S3上正常启动,但是Desktop的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.我觉得这很简单,我似乎找不到问题. (别笑我的班级名字,那是给我四岁的女儿的); 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任务(桌面-> run)可以完美运行.

Instead, running the Gradle task (desktop -> run) works perfectly.

要在IntelliJ中运行Gradle任务,

To run the Gradle task within IntelliJ,

  1. 按两次 Shift ,键入"Gradle"以打开 Gradle项目窗格
  2. 如果没有显示任何内容,请点击刷新所有Gradle项目"按钮
  3. 展开:桌面>任务>其他
  4. 双击运行"
  1. Hit Shift twice, type "Gradle" to open the Gradle projects pane
  2. Hit the "Refresh all Gradle projects" button if nothing is showing up
  3. Expand :desktop > Tasks > other
  4. Double-click "run"

这篇关于启动Desktop main时出现libgdx ClassNotFoundException-Mac,IntelliJ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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