I just stumbled upon setting the JAVA_HOME on a remote OS X Server. I tried following the output of whereis. But this was not leading me to the right track folders.
To make things short, just add this to your .profile/shell:
run inside a terminal:
defaults write com.apple.Terminal CopyAttributesProfile com.apple.Terminal.no-attributes