I get an error in the Eclipse console when trying to run a first person camera using LWJGL & Java.

"Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path"

I did include the jar's for libraries and I did add the VM argument -Djava.library.path=C:\lwjgl-2.5\native\windows\

Please help.

Dani AI

Generated

This error means the JVM can't find LWJGL's native library (the Windows DLLs) on the runtime library path. Adding the LWJGL JARs to the classpath is only half the job: the JVM must be able to load the native DLLs at runtime. Typical causes are: the native folder isn't the one actually used at launch, the run configuration doesn't get the VM argument, or the native DLL bitness doesn't match the JVM.

Checklist (quick, ordered):

  • Confirm the native folder actually contains the Windows native files (for LWJGL 2.x that includes the DLLs such as lwjgl.dll and OpenAL DLLs).
  • Make sure the VM argument that sets java.library.path is applied to the exact Run Configuration used to start the app (Run → Run Configurations → Java Application → Arguments → VM arguments).
  • In Eclipse an alternative is to set the native location per JAR: Project → Properties → Java Build Path → Libraries → expand the LWJGL JAR → “Native library location” → Edit → select the native folder. This avoids needing the VM arg.
  • Verify JVM vs native bitness: run the same JVM you use in Eclipse and check java -version (or check sun.arch.data.model) — 32-bit JVM requires 32-bit natives, 64-bit JVM requires 64-bit natives.
  • If the path contains spaces, quote it; avoid a dangling single backslash inside quotes (or use forward slashes).

Quick diagnostic program (prints what the JVM actually sees):

public class CheckNative {
    public static void main(String[] args) {
        System.out.println("java.library.path = " + System.getProperty("java.library.path"));
        System.out.println("os.arch = " + System.getProperty("os.arch"));
        System.out.println("sun.arch.data.model = " + System.getProperty("sun.arch.data.model"));
    }
}

As hinted, add both the JARs to the build path and the native location (or VM arg). Ignore broad "search" advice from for now — follow the checklist and the diagnostics above and the DLL-loading error will usually reveal the exact mismatch.

Recommended Answers

All 8 Replies

???

Uh...

!??!?!?!?!?

...

Un-answered topic is un-answered.

*cough cough cough*

Sorry, AaronLLF, it looks like no one here knows how to help you. Try searching google or post your question on a different forum.

Sorry to ask this but did you also add a refrence in the project as well as in eclips?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.