wavedata.create nullpointerexception

Started by amoeba, December 05, 2007, 21:47:11

Previous topic - Next topic

amoeba

I am getting an odd problem when trying to run the OpenAL lesson 5 example with netbeans.

When I try to run I get;
D:\lesson5>java -Djava.library.path=lib/win32 -jar "D:\lesson5\dist\lesson5.jar"
java.lang.NullPointerException
        at org.lwjgl.util.WaveData.create(WaveData.java:95)
        at org.lwjgl.util.WaveData.create(WaveData.java:112)
        at Lesson5.loadALData(Lesson5.java:125)
        at Lesson5.execute(Lesson5.java:222)
        at Lesson5.main(Lesson5.java:261)
Exception in thread "main" java.lang.NullPointerException
        at Lesson5.loadALData(Lesson5.java:126)
        at Lesson5.execute(Lesson5.java:222)
        at Lesson5.main(Lesson5.java:261)


Is this problem caused by a missing the openal32.dll? I have it in /lib/win32 with the rest of the DLLs.

amoeba

When I run in debug I get this further information:

ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183):  [../../../src/share/back/util.c:820]

Matzon

the debug stuff is unrelated, but the NPE is because the res folder isn't on the classpath so it fails to locate the file in the create method

amoeba

The res folder is the Eclipse folder where the classes get compiled or where the jar gets put?

Matzon

the res folder is the res folder when you extracted lwjgl :)

amoeba

Why do I need the res folder in classpath, it just contains some sound and image files?