0

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

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

I am doing that. So my settings in .bashrc wont be remembered by this new shell?
what is your first line? #!/bin/bash?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.