I see many add export JAVA_HOME=/usr/local/java/ to their bash script.
Can someone tell me why this is necessary and what will happen if I don’t do it?
JAVA_HOME is already set in my .bashrc. Why should I specify this again in my script?
Thanks for any help to this newbee…
because you may be starting a new shell #!/bin/sh may be your first line of the script. Check if you are starting bash in the first line of script.