When I import CharacterControl
like this " import com.jme3.bullet.control.CharacterControl "
but there is a line on the word " CharacterControl " ,and everytime I compile the code
it always shows “null pointer exception”
Is there anyone knows what is the wrong place?
So, most of the useful information in a NullPointerException is all of the parts you left out.
Let’s say this is all of the information in a NullPointerException:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
This much is the name:
x
This much is the stack trace:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
This is true of most exceptions but especially true for NullPointerExceptions. Saying “I got a NullPointerException” is only one teeny tine step away from “I have an error” in usefulness. It’s the single easiest type of exception to track down… but only with a stack trace.
I don’t think you get an exception at COMPILE time. Please report error correctly.
Okay sorry I didn't describe the problem very clearly.
But that is not the improtant point so forget the second part of my question
And now the problem is when I import CharacterControl
there is a line on the word " CharacterControl "
So I think the reason why I can't run the program completely is because of this .
You probably didn’t include some libs (or maybe you created your game as standard Java project).
I suggest to run the tutorials:
http://wiki.jmonkeyengine.org/doku.php/jme3#tutorials_for_beginners
Thanks!