Search code examples
typesimportcompiler-errorslibgdx

Libgdx: import com.badlogic.gdx.backends.lwjgl.LwjglApplication cannot be resolved to a type


Yeah i'm new to Libgdx and still semi-new to java, im going off of Steigerts tutorials, which i realize is a bit dated, but anyways im trying to make the desktoplauncher and this import won't work.

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

it says it cannot be resolved to a type


Solution

  • Use gdx setup ui http://libgdx.badlogicgames.com/nightlies/dist/gdx-setup-ui.jar

    Run it(java -jar). It will automatically generate all the libgdx projects for you. Then just import them in your workspace.

    Also, libgdx is growing very fast. If you notice a tutorial is outdated, do not keep following it and better look for another one. And you can also look in these examples, they are often updated: https://github.com/libgdx/libgdx/tree/master/demos