I am having a pathetic issue with Java in my mac osx 10.7.3 . Previously I installed it and it was working fine. After some changes in the .bash_profile and .profile file in
i have experienced the same problem, and after reading this post i have double checked the JAVA_HOME definition in .bash_profile. It is actually:
export JAVA_HOME=$(which java)
that, exactly as Anony-Mousse is explaining, is the executable. Changing it to:
export=/Library/Java/Home
fixes the problem, tho is still interesting to understand why it's valued in that way in the profile file.