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:
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.