Search code examples
eclipseubuntulibgdxlwjgl

libgdx can't start desktop project on ubuntu


so, I just created libgdx project for desktop and imported it (gradle) to eclipse. When I launch it this error pops up:

Exception in thread "LWJGL Application" java.lang.ExceptionInInitializerError
at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.setVSync(LwjglGraphics.java:446)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:118)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at org.lwjgl.opengl.LinuxDisplay.getAvailableDisplayModes(LinuxDisplay.java:954)
at org.lwjgl.opengl.LinuxDisplay.init(LinuxDisplay.java:738)
at org.lwjgl.opengl.Display.<clinit>(Display.java:138)
... 2 more
AL lib: (EE) alc_cleanup: 1 device not closed

I can't figure out what's happening. Project's created for android and launched in android studio working properly.


Solution

  • You need to install the xorg-xrandr package, see

    http://badlogicgames.com/forum/viewtopic.php?f=11&t=18801