[SOLVED] HelloCollision: NoClassDefFoundError

Hello,

I am a beginner and I just installed jMonkeyEngine SDK 3.1.0-stable-final on Windows 10 x64 and started working my way through the tutorials in jme3test.helloworld. The first ones work out of the box but when I try to run HelloCollision.java, I get the following error. I believe that I have made the default installation and that this should work out of the box without any edits or configuration actions? Maybe I overlooked something, but I cannot figure out what.

ant -f C:\Users\hp\Documents\JMonkey\JmeTests2 -Djavac.includes=jme3test/helloworld/HelloCollision.java -Dnb.internal.action.name=run.single -Drun.class=jme3test.helloworld.HelloCollision run-single
init:
Deleting: C:\Users\hp\Documents\JMonkey\JmeTests2\build\built-jar.properties
deps-jar:
Updating property file: C:\Users\hp\Documents\JMonkey\JmeTests2\build\built-jar.properties
Compiling 1 source file to C:\Users\hp\Documents\JMonkey\JmeTests2\build\classes
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning
compile-single:
run-single:
huhtikuuta 14, 2017 1:43:59 IP. java.util.prefs.WindowsPreferences
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(…) returned error code 5.
huhtikuuta 14, 2017 1:44:01 IP. com.jme3.system.JmeDesktopSystem initialize
INFO: Running on jMonkeyEngine 3.1-stable

  • Branch: HEAD
  • Git Hash: af04bf9
  • Build Date: 2017-02-19
    huhtikuuta 14, 2017 1:44:02 IP. com.jme3.system.lwjgl.LwjglContext printContextInitInfo
    INFO: LWJGL 2.9.3 context running on thread jME3 Main
  • Graphics Adapter: aticfx64
  • Driver Version: 8.17.10.1474
  • Scaling Factor: 1
    huhtikuuta 14, 2017 1:44:02 IP. com.jme3.renderer.opengl.GLRenderer loadCapabilitiesCommon
    INFO: OpenGL Renderer Information
  • Vendor: ATI Technologies Inc.
  • Renderer: AMD Radeon™ R4 Graphics
  • OpenGL Version: 4.5.13447 Compatibility Profile Context 16.300.2701.0
  • GLSL Version: 4.50
  • Profile: Compatibility
    huhtikuuta 14, 2017 1:44:03 IP. com.jme3.audio.openal.ALAudioRenderer initOpenAL
    INFO: Audio Renderer Information
  • Device: OpenAL Soft
  • Vendor: OpenAL Community
  • Renderer: OpenAL Soft
  • Version: 1.1 ALSOFT 1.15.1
  • Supported channels: 64
  • ALC extensions: ALC_ENUMERATE_ALL_EXT ALC_ENUMERATION_EXT ALC_EXT_CAPTURE ALC_EXT_DEDICATED ALC_EXT_disconnect ALC_EXT_EFX ALC_EXT_thread_local_context ALC_SOFT_loopback
  • AL extensions: AL_EXT_ALAW AL_EXT_DOUBLE AL_EXT_EXPONENT_DISTANCE AL_EXT_FLOAT32 AL_EXT_IMA4 AL_EXT_LINEAR_DISTANCE AL_EXT_MCFORMATS AL_EXT_MULAW AL_EXT_MULAW_MCFORMATS AL_EXT_OFFSET AL_EXT_source_distance_model AL_LOKI_quadriphonic AL_SOFT_buffer_samples AL_SOFT_buffer_sub_data AL_SOFTX_deferred_updates AL_SOFT_direct_channels AL_SOFT_loop_points AL_SOFT_source_latency
    huhtikuuta 14, 2017 1:44:03 IP. com.jme3.audio.openal.ALAudioRenderer initOpenAL
    WARNING: Pausing audio device not supported.
    huhtikuuta 14, 2017 1:44:03 IP. com.jme3.audio.openal.ALAudioRenderer initOpenAL
    INFO: Audio effect extension version: 1.0
    huhtikuuta 14, 2017 1:44:03 IP. com.jme3.audio.openal.ALAudioRenderer initOpenAL
    INFO: Audio max auxiliary sends: 4
    huhtikuuta 14, 2017 1:44:03 IP. com.jme3.app.LegacyApplication handleError
    SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
    java.lang.NoClassDefFoundError: com/bulletphysics/collision/dispatch/CollisionConfiguration
    at com.jme3.bullet.BulletAppState.startPhysics(BulletAppState.java:164)
    at com.jme3.bullet.BulletAppState.stateAttached(BulletAppState.java:211)
    at com.jme3.app.state.AppStateManager.attach(AppStateManager.java:133)
    at jme3test.helloworld.HelloCollision.simpleInitApp(HelloCollision.java:81)
    at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:220)
    at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130)
    at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:211)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.ClassNotFoundException: com.bulletphysics.collision.dispatch.CollisionConfiguration
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    … 8 more

The Problem is, I can’t update 3.1.0-stable as it is already pushed and a 3.1.0-stable-2 would be more confusing

Please excuse if there is something obvious that I do not notice. I tried to search the HelloCollision.java for “jme-jbullet” but do not find any occurrence of “jbullet”, so I did not figure out what to replace. HelloCollision.java only has the following imports:

import com.jme3.bullet.BulletAppState;
import com.jme3.bullet.collision.shapes.CapsuleCollisionShape;
import com.jme3.bullet.collision.shapes.CollisionShape;
import com.jme3.bullet.control.CharacterControl;
import com.jme3.bullet.control.RigidBodyControl;
import com.jme3.bullet.util.CollisionShapeFactory;

Or should I edit something other than the HelloCollision.java file?

Yes. Edit the projects Properties or rather the libraries which it uses

1 Like

Hey as Darkchoad said, go to your libraries section in your project properties and make sure that you either have jbullet.jar or native-bullet.jar added, do NOT use both. I would recommend you to use native-bullet because it’s newer and faster. So make sure you delete jbullet and also make sure that bullet AND bullet-native is added. Then everything should work.

1 Like

Thanks a lot - with these instructions everything was very straightforward and it works now.

1 Like