Setting JAVA_HOME

Tim Graboski July 20, 2011

Hi. I'm installing Jira on my linux computer for personal use. I am learning linux but it's a little spotty in some places, particularly with the JAVA_HOME variable. I know that from a terminal I can go

$ export JAVA_HOME=/usr/lib/path/to/java/jdk

but I believe this only sets the variable for this session, for me. Is this true?

If so, how do I make it so that JAVA_HOME is set before Jira starts? I'd like Jira to run when I turn on my computer, so it shouldn't have to wait for me to set it.

3 answers

1 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 20, 2011

>but I believe this only sets the variable for this session, for me. Is this true?

Yes. But if you add it to the file .bashrc it will run every time you log in automatically (assuming you use bash as your shell - it is the default for most of the more popular distros)

Similarly, you can add it to the scripts you use to run Jira. Have a look for "setenv.sh" if you're on Jira standalone.

0 votes
Deleted user July 20, 2011

I think export will set the variable for as long as you ar logged in. However there is another way:

http://glassonionblog.wordpress.com/2008/07/21/linux-setting-java_home-for-a-single-user-and-all-users/

0 votes
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 20, 2011

Set it under the bash profile as explained here.

Suggest an answer

Log in or Sign up to answer