If you try:
It should confirm post #2 in that your JAVA_HOME environment variable does not exist
AND that you haven't added the executable directory of your Java installation into your PATH.
Basically you need to add the following to your bash_profile:
Code:
export JAVA_HOME=/path/to/my/java/installation/
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
Once in your
PATH at an OS level you can run java -version.
Having JAVA_HOME setup is also very useful in that your application servers and/or IDE will look for this variable.