找不到libGDX ApplicationListener [英] libGDX ApplicationListener not found

查看:105
本文介绍了找不到libGDX ApplicationListener的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我现在正在为台式机和Android开发2D游戏.我安装libGDX是因为我听说它使使用Java开发游戏更加容易.但是当我运行桌面代码时,它会显示此错误 java: cannot access com.badlogic.gdx.ApplicationListener class file for com.badlogic.gdx.ApplicationListener not found这是我正在运行的主要代码:

Hey right now i'm making a 2D game, for the desktop and Android. I installed libGDX because i heard that it made developing a game in java easier. But when i run the desktop code it shows up with this error java: cannot access com.badlogic.gdx.ApplicationListener class file for com.badlogic.gdx.ApplicationListener not found This is the Main code that i'm running:

    package com.rare.Forms;

import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;




public class Main {
    public static void main(String[] args) {
        LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
        cfg.title = "MyGame";
        cfg.useGL20 = false;
        cfg.width = 480;
        cfg.height = 320;

        new LwjglApplication(new MyGame(), cfg);
    }
}

我已尝试多次安装该库,但始终显示相同的错误. 如果有人可以帮助我,我将非常高兴. 哦,抱歉英语不好,这不是我的出生语言.

I've tried installing the library, multiple times but it always shows the same error. I would be very greatfull you someone could help me. Ohh and sorry for the bad english, it isn't my birth language.

推荐答案

原始答案不再有效,因为链接的教程不再存在,并且LibGDX从那时起已经发生了很大的变化. 现在有一个有关如何设置环境的官方文档. 请注意,建议使用Android Studio或IntelliJ,因为它是唯一正式支持Android的IDE.

The original answer is no longer valid, as the linked tutorial does not exist anymore and LibGDX has changed quite a bit since then. There is now an official documentation on how to setup the environment. Note, that Android Studio or IntelliJ is recommended, as it is the only IDE to officially support Android.

我将其发布为答案,您可以将其标记为已解决,并且将来可以帮助其他人. 如果您使用的是Eclipse,则

I am posting it as an answer that you can mark it as solved and it can help others in future. If you are using Eclipse the setup in this tutorial should help you. If you are using intellij you can load the project in eclipse do this setup and then import it to intellij. I am sure that you can do the things also in intellij without eclipse but i don't know intellij so i can't help you with this.

这篇关于找不到libGDX ApplicationListener的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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