libgdx/libgdx · critical · GdxRuntimeException
Unknown LWJGL platform:
Error message
Unknown LWJGL platform:
What it means
Thrown by LwjglNativesLoader.load() when the OS+bitness combination detected by SharedLibraryLoader maps to no known LWJGL native library pair (e.g. lwjglLib stays null). The switch covers Windows/Linux (32/64-bit) and macOS; any other platform or unknown bitness yields this error before any extraction is attempted.
Source
Thrown at backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglNativesLoader.java:83
break;
case MacOsX:
lwjglLib = "liblwjgl.dylib";
openalLib = "openal.dylib";
break;
case Linux:
switch (bitness) {
case _32:
lwjglLib = "liblwjgl.so";
openalLib = "libopenal.so";
break;
case _64:
lwjglLib = "liblwjgl64.so";
openalLib = "libopenal64.so";
break;
}
break;
}
if (lwjglLib == null) throw new GdxRuntimeException("Unknown LWJGL platform: " + os + ", " + bitness);
nativesDir = loader.extractFile(lwjglLib, null).getParentFile();
if (!LwjglApplicationConfiguration.disableAudio) loader.extractFileTo(openalLib, nativesDir);
} catch (Throwable ex) {
throw new GdxRuntimeException("Unable to extract LWJGL natives.", ex);
}
System.setProperty("org.lwjgl.librarypath", nativesDir.getAbsolutePath());
load = false;
}
}
View on GitHub (pinned to 97f4086187)
Solutions
- Run on a supported x86/x86_64 Windows/Linux/macOS desktop for the LWJGL backend
- For ARM boards, use the LWJGL3 backend (gdx-backend-lwjgl3) with ARM64 natives, or the headless backend if no rendering is needed
- Pre-set -Dorg.lwjgl.librarypath to an existing native extraction dir so this loader is bypassed (set LwjglNativesLoader.load = false accordingly)
Example fix
// before: gdx-backend-lwjgl (LWJGL 2) on ARM Linux -> "Unknown LWJGL platform" new LwjglApplication(new MyGame(), config); // after: use the LWJGL3 backend which ships ARM natives new Lwjgl3Application(new MyGame(), new Lwjgl3ApplicationConfiguration());
Defensive patterns
Strategy: fallback
Validate before calling
String os = System.getProperty("os.name").toLowerCase();
String arch = System.getProperty("os.arch");
boolean supported = (os.contains("win") || os.contains("linux") || os.contains("mac"))
&& (arch.equals("x86") || arch.equals("i386") || arch.equals("amd64") || arch.equals("x86_64"));
if (!supported) { /* route to lwjgl3 or headless backend */ } Prevention
- Check os.name/os.arch before launching the LWJGL2 backend
- Ship the LWJGL3 backend for ARM/portable targets
- Document supported platforms up front
When it happens
Trigger: Running the desktop backend on an unsupported platform (e.g. ARM Linux before LWJGL supported it, Solaris, FreeBSD) or when os.arch is unexpected so bitness resolution fails, leaving lwjglLib null.
Common situations: Deploying to Raspberry Pi / ARM boards (libGDX's bundled LWJGL 2 has no ARM natives); exotic JVMs reporting unusual os.arch values; running on BSD with a Linux JVM reporting wrong os.name.
Related errors
- Couldn't set display mode + config.width + x + config.heigh
- OpenGL is not supported by the video driver.
- OpenGL 2.0 or higher with the FBO extension is required. Ope
- Unable to extract LWJGL natives.
- Couldn't load ANGLE.
AI-assisted analysis of libgdx/libgdx@97f4086187 (2026-08-14).
Data as JSON: /api/errors/f5b886dfee22a01a.
Report an issue: GitHub.