LWJGL Forum

Programming => LWJGL Documentation => Topic started by: SilentShaddo on January 24, 2011, 16:04:45

Title: Space Invader Sound Loading Problem
Post by: SilentShaddo on January 24, 2011, 16:04:45
Hey guys, I've followed everything on the http://lwjgl.com/wiki/index.php?title=Setting_Up_LWJGL_with_JCreator to set up space invader on jcreator but i am getting this problem:



Exception in thread "main" java.lang.NullPointerException
    at org.lwjgl.examples.spaceinvaders.SoundManager.addSound(SoundManager.java:157)
    at org.lwjgl.examples.spaceinvaders.Game.initialize(Game.java:250)
    at org.lwjgl.examples.spaceinvaders.Game.<init>(Game.java:182)
    at org.lwjgl.examples.spaceinvaders.Game.main(Game.java:588)


Does anyone know what I am doing wrong?
Title: Re: Space Invader Sound Loading Problem
Post by: kappa on January 24, 2011, 16:32:47
make sure the resources for the space invaders demo are also on the class path (i.e. the 'res' folder which contains the wav files).
Title: Re: Space Invader Sound Loading Problem
Post by: SilentShaddo on January 24, 2011, 22:35:15
I install it in my downloads folder. This makes it

C:\Users\Vong Vang\Downloads\lwjgl-2.6

and that res is also in that lwjgl-2.6 folder.

still giving me the same error
Title: Re: Space Invader Sound Loading Problem
Post by: SilentShaddo on January 26, 2011, 15:36:57
Ah. Found the solution. ^^ thanks bro
Title: Re: Space Invader Sound Loading Problem
Post by: zakrn on February 14, 2011, 04:37:19
im also having this problem and cant seem to fix it, do tell.
Title: Re: Space Invader Sound Loading Problem
Post by: Matzon on February 14, 2011, 06:35:09
as kappa says - you need to make sure the res folder is on the class path
Title: Re: Space Invader Sound Loading Problem
Post by: Mickelukas on February 14, 2011, 14:22:21
I got the same error when trying to add an ogg file. After having looked around a lot yesterday on the forum and other pages I came to the conclusion to use JOrbis for ogg sounds instead of JOAL.
Title: Re: Space Invader Sound Loading Problem
Post by: lobsterman on June 25, 2013, 15:39:59
same problem here and a bit of additional hand-holding would be great ... i assume i am adding the path to the eclipse project as follows

- go to project properties
- go to Resource
- select linked Resources
- in Path Variables click "New..."
- Name it "SPACEINVADERS_LOC" and select Location Folder res/spaceinvaders wherever the lwjgl folder is located

run ... but no go. same exception as before

Exception in thread "main" java.lang.NullPointerException
   at org.lwjgl.examples.spaceinvaders.SoundManager.addSound(SoundManager.java:157)
   at org.lwjgl.examples.spaceinvaders.Game.initialize(Game.java:250)
   at org.lwjgl.examples.spaceinvaders.Game.<init>(Game.java:182)
   at org.lwjgl.examples.spaceinvaders.Game.main(Game.java:588)
AL lib: (EE) alc_cleanup: 1 device not closed

any suggestions where i am going wrong?