LWJGL 3 exposes runtime configuration through two equivalent mechanisms: JVM system properties (set on the command line before the process starts) and theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/LWJGL/lwjgl3/llms.txt
Use this file to discover all available pages before exploring further.
Configuration class in org.lwjgl.system (set programmatically at startup). Both mechanisms read from the same state; a Configuration field simply wraps its corresponding property name so your IDE can autocomplete it.
Static vs. dynamic options
Every configuration option falls into one of two categories.Static options
static final fields. You must set these before any other LWJGL class is loaded. Examples: DEBUG, STACK_SIZE, MEMORY_ALLOCATOR.Dynamic options
LIBRARY_PATH, DEBUG_MEMORY_ALLOCATOR_FAST.Setting options
- System property (command line)
- Programmatic (Java)
Core options
LIBRARY_PATH — org.lwjgl.librarypath
LIBRARY_PATH — org.lwjgl.librarypath
java.library.path when LWJGL searches for native shared libraries. Accepts one or more paths separated by the platform path separator (: on Unix, ; on Windows).Usage: DynamicSHARED_LIBRARY_EXTRACT_DIRECTORY — org.lwjgl.system.SharedLibraryExtractDirectory
SHARED_LIBRARY_EXTRACT_DIRECTORY — org.lwjgl.system.SharedLibraryExtractDirectory
SHARED_LIBRARY_EXTRACT_PATH — org.lwjgl.system.SharedLibraryExtractPath
SHARED_LIBRARY_EXTRACT_PATH — org.lwjgl.system.SharedLibraryExtractPath
MEMORY_ALLOCATOR — org.lwjgl.system.allocator
MEMORY_ALLOCATOR — org.lwjgl.system.allocator
MemoryUtil (memAlloc, memFree, etc.). Supported string values: jemalloc, rpmalloc, system. Can also be set programmatically to a MemoryAllocator instance.Usage: StaticSTACK_SIZE — org.lwjgl.system.stackSize
STACK_SIZE — org.lwjgl.system.stackSize
MemoryStack instance. Defaults to 64 (64 KB). Increase this if you see stack overflow errors from deeply nested struct allocations.Usage: StaticDebug options
DEBUG — org.lwjgl.util.Debug
DEBUG — org.lwjgl.util.Debug
DEBUG_LOADER and DEBUG_FUNCTIONS to have any effect.Usage: StaticDEBUG_MEMORY_ALLOCATOR — org.lwjgl.util.DebugAllocator
DEBUG_MEMORY_ALLOCATOR — org.lwjgl.util.DebugAllocator
memAlloc / memFree call and reports leaks at JVM exit. Each allocation records a stack trace, so performance impact can be significant. See also DEBUG_MEMORY_ALLOCATOR_FAST for a lighter-weight alternative.Usage: StaticDEBUG_MEMORY_ALLOCATOR_FAST — org.lwjgl.util.DebugAllocator.fast
DEBUG_MEMORY_ALLOCATOR_FAST — org.lwjgl.util.DebugAllocator.fast
true, skips stack trace generation for each tracked allocation. Leaks are still reported at exit, but without the originating stack trace. Toggle at runtime to minimize overhead while still detecting leaks.Usage: DynamicDEBUG_STACK — org.lwjgl.util.DebugStack
DEBUG_STACK — org.lwjgl.util.DebugStack
MemoryStack. When active, each push() / pop() records a stack trace. If a frame is popped in a different method than the one that pushed it, an error is reported immediately.Usage: StaticDEBUG_FUNCTIONS — org.lwjgl.util.DebugFunctions
DEBUG_FUNCTIONS — org.lwjgl.util.DebugFunctions
DEBUG to be enabled. May produce false positives for functions in unused extension classes.Usage: StaticDISABLE_CHECKS — org.lwjgl.util.NoChecks
DISABLE_CHECKS — org.lwjgl.util.NoChecks
Graphics and compute explicit-init options
Several APIs that have their own initialization step default to auto-initializing the first time they are accessed. Set the corresponding_EXPLICIT_INIT option to true to take control of initialization yourself.
EGL_EXPLICIT_INIT — org.lwjgl.egl.explicitInit
EGL_EXPLICIT_INIT — org.lwjgl.egl.explicitInit
true, disables automatic initialization of the EGL library. You must call EGL.create() manually before using any EGL function.Usage: StaticOPENAL_EXPLICIT_INIT — org.lwjgl.openal.explicitInit
OPENAL_EXPLICIT_INIT — org.lwjgl.openal.explicitInit
true, disables automatic initialization of the OpenAL library. You must call AL.create() / ALC.create() manually.Usage: StaticOPENGL_EXPLICIT_INIT — org.lwjgl.opengl.explicitInit
OPENGL_EXPLICIT_INIT — org.lwjgl.opengl.explicitInit
true, disables automatic initialization of the OpenGL library. You must call GL.createCapabilities() manually after making an OpenGL context current.Usage: StaticVULKAN_EXPLICIT_INIT — org.lwjgl.vulkan.explicitInit
VULKAN_EXPLICIT_INIT — org.lwjgl.vulkan.explicitInit
true, disables automatic initialization of the Vulkan library. You must call VK.create() before using any Vulkan function.Usage: StaticOPENCL_EXPLICIT_INIT — org.lwjgl.opencl.explicitInit
OPENCL_EXPLICIT_INIT — org.lwjgl.opencl.explicitInit
true, disables automatic initialization of the OpenCL library.Usage: StaticOPENXR_EXPLICIT_INIT — org.lwjgl.openxr.explicitInit
OPENXR_EXPLICIT_INIT — org.lwjgl.openxr.explicitInit
true, disables automatic initialization of the OpenXR library.Usage: StaticFFM backend options
These options are relevant only when running on JDK 25+ with the FFM backend active. See FFM API support for background.FFM_UPCALL_ARENA — org.lwjgl.system.ffm.upcall.arena
FFM_UPCALL_ARENA — org.lwjgl.system.ffm.upcall.arena
Arena type used to allocate upcall stubs. Accepted values: auto (default, GC-managed), confined (thread-confined, immediate release), shared (thread-shared, immediate release but slower).Usage: StaticFFM_UPCALL_EXCEPTION_CATCH — org.lwjgl.system.ffm.upcall.exception.catch
FFM_UPCALL_EXCEPTION_CATCH — org.lwjgl.system.ffm.upcall.exception.catch
true (default), uncaught exceptions from FFM upcalls are caught and forwarded to the exception handler rather than terminating the JVM. Set to false only when your upcall handles exceptions internally.Usage: DynamicFFM_UPCALL_EXCEPTION_HANDLER — org.lwjgl.system.ffm.upcall.exception.handler
FFM_UPCALL_EXCEPTION_HANDLER — org.lwjgl.system.ffm.upcall.exception.handler
Consumer<Throwable> instance programmatically, or a fully-qualified class name via property.Usage: DynamicFFM_DEFAULT_NULLABLE_ANNOTATION — org.lwjgl.system.ffm.nullable
FFM_DEFAULT_NULLABLE_ANNOTATION — org.lwjgl.system.ffm.nullable
MemorySegment parameters accept null. Defaults to auto (LWJGL scans the classpath for popular annotations). Set to none to disable auto-detection.Usage: Static