THE problem:
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of these environment variable is needed to run this program
THE investigation:
This occurs when you try to run any bat\sh from the jira base dir.
version.bat
THE solution: from here
For my situation, I`ve just add C:\Progra~1\Atlassian\JIRA\jre
Right-click the My Computer icon on your desktop and select Properties.
- Click the Advanced tab.
- Click the Environment Variables button.
- Under System Variables, click New.
- Enter the variable name as JAVA_HOME.
- Enter the variable value as the installation path for the Java Development Kit.
- If your Java installation directory has a space in its path name, you should use the shortened path name (e.g.C:\Progra~1\Java\jre6) in the environment variable instead.
Note for Windows users on 64-bit systems
Progra~1 = ‘Program Files’
Progra~2 = ‘Program Files(x86)’
- If your Java installation directory has a space in its path name, you should use the shortened path name (e.g.C:\Progra~1\Java\jre6) in the environment variable instead.
- Click OK.
- Click Apply Changes.
- Close any command window which was open before you made these changes, and open a new command window. There is no way to reload environment variables from an active command prompt. If the changes do not take effect even after reopening the command window, restart Windows.
- If you are running the Confluence EAR/WAR distribution, rather than the regular Confluence distribution, you may need to restart your application server.