Typing:
will show you the location of java in your path. If you're expecting different version output, perhaps you have two versions of java installed?
If that's the case, decide which java you want to use by default, modify $PATH accordingly, and specify the complete path whenever you want to use the other java.