Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

JAVA_HOME already JRE - Need JAVA_HOME for jdk as well

Josh Black November 3, 2013

I see that to install stash as a service, it requires that JAVA_HOME point to a jdk. I'm installing Stash on a server that already uses the JAVA_HOME (pointing to a jre) variable for other applications. Is there an easy way to make stash look for a different variable?

6 answers

1 accepted

0 votes
Answer accepted
Josh Black November 4, 2013

Many thanks to C.Faysal for prompting the research.

I ended up having to set JAVA_HOME in service.bat and point it to the jdk. The environment variables were left with JAVA_HOME pointing to the JRE.

1 vote
C_ Faysal
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.
November 3, 2013
Josh Black November 3, 2013

Thanks for the quick response! This article looks like it addresses the setenv file, which Stash ignores when installed as a service.

Is there a way to make Stash use "JAVA_HOME_JDK", for example, instead?

Thanks

C_ Faysal
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.
November 3, 2013
Did you try to put it in the init script? Usually setenv.sh shouldn't be ignored though. Works fine for me in all other atlassian apps
Josh Black November 3, 2013

I just tried using the SET command in the setenv batch file to point to the JDK but it doesn't seem to work. When you say "init script", are you talking about "startup.bat"?

Thanks again for helping out with this.

Josh Black November 3, 2013

Apologies - should have mentioned - installing on Windows. Would this just need to be set in start-stash.bat?

EDIT: Just noticed that start-stash.bat doesn't reference JAVA_HOME, so my guess was probably incorrect. Although, it does appear that service.bat references a JAVA_HOME and JRE_HOME. Would setting in this file help?

C_ Faysal
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.
November 3, 2013
No i mean the your /etc/init.d/stash? Script you use to call the app
Josh Black November 3, 2013

I set the variable in service.bat, ran the bat to install the service, and everything is working great. If you want to post this as an answer, I'll mark it as answered so you can get the points.

Thank you so much for such quick responses. I really appreciate it.

0 votes
Michael Ireland March 28, 2014

Java home environment variable for windows install service (Service.bat) is different for JDK and JRE.
For JRE change environment variable "JAVA_HOME" to "JRE_HOME"
Read Service.bat for details on the difference.

0 votes
Michael Heemskerk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 3, 2013

Josh,

Looking at the installation instructions for Tomcat (which Stash uses), you should be able to do:

tomcat7 //US//STASH --JavaHome <path-to-alternate-java-home>

I haven't tested this though.

Cheers,

Michael

0 votes
C_ Faysal
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.
November 3, 2013
Oh windows. Hmm no experience with that. Ain't there a setenv.bat ? If so this is your file then
C_ Faysal
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.
November 3, 2013
No problem. I didnt knew the exact name but i remember seing some bat files in the bin dir
Josh Black November 3, 2013

Sorry, I meant to mention service.bat. It still seemed to ignore setenv.

Thanks

0 votes
C_ Faysal
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.
November 3, 2013
Oh windows. Hmm no experience with that. Ain't there a setenv.bat ? If so this is your file then

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events