... NullPointerException on JMonkey3?!?!?!

I was doing the third tutorial of JmonkeyEngine 3, and then comes the NullPointerException



LINE 30Spatial teapot = assetManager.loadModel(“Models/Teapot/Teapot.obj”);

LINE 40 Material mat_default = new Material(

LINE 41 assetManager, “Common/MatDefs/Misc/ShowNormals.j3md”);

LINE 42 teapot.setMaterial(mat_default); (This is line 42)



java.lang.NullPointerException

at mygame.Main.simpleInitApp(Main.java:42)

at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:155)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:102)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:147)

at java.lang.Thread.run(Thread.java:619)

BUILD SUCCESSFUL (total time: 7 seconds)



This is exactly the code from the tutorial and is there importing to do? (Well, it is presumably built into the SDK which is the reason why this became more perplexing)

oops the line 30 is line 39… Typo

You dont have the example assets in your projects classpath. Right-click your project, select “Properties” go to Libraries, press Add Library and add the “jme3-test-data” library.

o ty