Skip to main content
criticalJava ErrorsAffects: Java Edition

How to Fix NoClassDefFoundError: LWJGL

NoClassDefFoundError for an org/lwjgl class means a LWJGL jar is missing from the classpath. Which jars 26.2 needs and how to get them back.

Quick Fix

Reinstall the version from the launcher so it downloads every library again, and don't mix in LWJGL jars from other versions.

Error Message

java.lang.NoClassDefFoundError: org/lwjgl/opengl/GL

How to Fix

1

Close the game, delete the folder of the broken version in versions, and start that version again from the launcher.

2

If the error returns, delete libraries/org/lwjgl so the launcher downloads the LWJGL jars again.

3

In a custom launcher or script, check that the classpath contains every org.lwjgl library from the version file, including the natives jars for your system.

4

Remove LWJGL jars from other versions that you added yourself.

5

If the message names another class, such as org/lwjgl/glfw/GLFW, the same fix applies to that module.

Common Causes

  • A LWJGL jar is missing from the classpath. Minecraft 26.2 lists twelve LWJGL 3.4.1 modules in its version file, and org/lwjgl/opengl/GL comes from lwjgl-opengl.
  • The libraries folder is incomplete or damaged, for example after an interrupted download or a cleanup tool that removed files.
  • A custom launcher or launch script builds its own classpath and leaves a jar out. The official version file fills the classpath in through ${classpath}, so a script has to list every library itself.
  • LWJGL jars from another version were copied in by hand. Every LWJGL module for 26.2 is version 3.4.1.

Diagnostic Steps

  1. Close the game.
  2. Delete the broken version folder.
  3. Start the version from the launcher.
  4. Delete libraries/org/lwjgl if the error returns.

FAQ

What is LWJGL?

The Lightweight Java Game Library gives Java access to native APIs. Minecraft 26.2 uses it for the window and input through GLFW, for sound through OpenAL and for drawing through OpenGL or Vulkan.

How is NoClassDefFoundError different from ClassNotFoundException?

Both mean Java couldn't find a class. NoClassDefFoundError is thrown when code that was built against the class tries to use it, so the class existed when the game was made but is missing now.

Which LWJGL version does Minecraft 26.2 use?

LWJGL 3.4.1, split into modules such as lwjgl, lwjgl-glfw, lwjgl-opengl, lwjgl-openal and lwjgl-vulkan, most of them with natives jars for Windows, Linux and macOS.

Related Errors

Need More Help?