JAVA_HOME already JRE - Need JAVA_HOME for jdk as well

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

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.

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

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

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.

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?

No i mean the your /etc/init.d/stash? Script you use to call the app

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.

Oh windows. Hmm no experience with that. Ain't there a setenv.bat ? If so this is your file then
Oh windows. Hmm no experience with that. Ain't there a setenv.bat ? If so this is your file then
No problem. I didnt knew the exact name but i remember seing some bat files in the bin dir

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

Thanks

0 vote

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

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.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Marketplace Apps

Tips on how to choose the best estimation method for your planning

Planning and grooming sessions all come with their own sets of rules. Team members meet to estimate stories or other work items, all according to an agreed-upon process. And with every session comes ...

77 views 0 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you