Tutorial questions and bugs


I’m learning jME using wiki tutorials, and I’ve found that they are quite old (deprecated). Using source files directly from repository usually helped, but not in this case. I’m now on HelloIntersection, the problem is that sound file cannot be loaded from jme jar:

laserSound = SoundSystem.create3DSample( getClass().getResource( "/jmetest/data/sound/laser.ogg" ) );

One line above, explosion.wav loads with no problems, but on this line I get:

java.lang.NoClassDefFoundError: com/jcraft/jogg/SyncState
   at com.jmex.sound.openAL.objects.util.OggInputStream.<init>(Unknown Source)
   at com.jmex.sound.openAL.objects.util.SampleLoader.loadOGG(Unknown Source)
   at com.jmex.sound.openAL.objects.util.SampleLoader.loadBuffer(Unknown Source)
   at com.jmex.sound.openAL.objects.Sample3D.<init>(Unknown Source)
   at com.jmex.sound.openAL.objects.Sample3D.<init>(Unknown Source)
   at com.jmex.sound.openAL.SoundSystem.create3DSample(Unknown Source)
   at HelloIntersection.setupSound(HelloIntersection.java:130)
   at HelloIntersection.simpleInitGame(HelloIntersection.java:78)
   at com.jme.app.BaseSimpleGame.initGame(Unknown Source)
   at com.jme.app.BaseGame.start(Unknown Source)
   at HelloIntersection.main(HelloIntersection.java:74)

the file is there... so this must be a bug reading ogg file? Or do I need extra library to make it work?

You need the jogg and jorbis jars in your class path.