Please skip these instructions if you are intend to use or have used the Windows Installer or Linux Installer to install JIRA, since these executable files will install and configure their own JRE to run JIRA. |
On this page:
1. Installing Java
JIRA requires Oracle's (formerly Sun's) Java Development Kit (JDK) or Java Runtime Environment (JRE) platform to run. Refer to Supported Platforms for details on the Java platform versions that JIRA supports.
Oracle's JDK/JRE can be downloaded from Oracle's website.
Linux distributions frequently have an open-source implementation of Java called GCJ installed. Do not use this Java platform — it is incomplete and JIRA will not run successfully on it.
You can test whether you have the correct Java platform by running java -version:
On recent Linux distributions, Oracle's (formerly Sun's) JDK can be installed with a command like sudo apt-get install sun-java6-jdk (for Ubuntu).
On some X.org-based distros (eg. Fedora Core 4), you may see an error like this:
If you do, you will need to install the xorg-x11-deprecated-libs package (Fedora) or equivalent (check Google).
2. Setting JAVA_HOME
Once the JDK or JRE is installed, you will need to set the JAVA_HOME environment variable, whose value is the root directory of the JDK/JRE.
Some JDK/JRE installers set this automatically (check by typing 'echo %JAVA_HOME%' in a Windows command prompt, or 'echo $JAVA_HOME' in a Linux/UNIX console).
Linux-based computers
On many Linux-based computers, the JAVA_HOME environment variable is set in the /etc/environment file.
If JAVA_HOME is not defined in this file, you can set it using the following command at a shell prompt, when logged in with 'root' level permissions:
echo JAVA_HOME="path/to/JAVA_HOME" >> /etc/environment
If, however, JAVA_HOME is already defined in this file, open the /etc/environment file in a text editor and modify its value to the appropriate path/to/JAVA_HOME — that is:
JAVA_HOME="path/to/JAVA_HOME"
Windows-based computers
If this environment variable is not set on a Windows-based computer, you can set it in the Control Panel using the following procedure:
- Open the Windows 'Advanced' system properties dialog box:
- On Windows XP-based operating systems, right-click on the My Computer icon on your desktop (or via the Start menu), select 'Properties' and click the 'Advanced' tab.
- On Windows 7-based operating systems, right-click the Computer icon on your desktop (or via the Start menu), select 'Properties', click 'Advanced system settings', select 'Properties' and click the 'Advanced' tab.
- Click the Environment Variables button.
- Click one of the New buttons (to define a new environment variable for your user account, or if available, system-wide).
- Type
JAVA_HOMEas the variable name and the directory where you installed Java.

- After clicking the required 'OK' buttons to save your changes, your
JAVA_HOMEenvironment variable should be available in a new command prompt window. If not or if necessary, restart your computer.
3. Confirming that Java Works
Once the steps above have been done, it should be possible to open a command prompt/console and type (in Windows): %JAVA_HOME%\bin\javac
If you see something similar to the following, then Java has been correctly set up on your computer:
If you subsequently start JIRA and you receive an error like Windows cannot find '-Xms128m', then you may not have correctly set JAVA_HOME. Please verify step 2 of the procedure above.
Next Step
Installing JIRA from an Archive File on Windows, Linux or Solaris







15 Comments
Hide/Show CommentsFeb 17, 2010
Aren Cambre
How about instructions for setting JAVA_HOME for Linux users?
Also not sure sun-java6-jdk is a good idea. That is the entire JDK. Isn't just the JRE needed?
Feb 20, 2010
Natalia
To set JAVA_HOME for ubuntu I did following:
to find out where java was installed:
whereis javac (the result of executing will be the path)
ls -al path (for example: ls -al /usr/bin/javac)
and repeat this step while you find the real path... (ls -al /etc/alternatives/javac)
to set JAVA_HOME:
JAVA_HOME= path to java (JAVA_HOME=/usr/lib/jvm/java-6-sun)
export JAVA_HOME
Apr 13, 2010
Andrew Dixon
I put the JAVA_HOME environment variable in /etc/environment. The first thing you'll want to do
is make sure that you have the right path:
$ls /usr/lib/jvm
if that is the path to your java directory, execute the next instruction to set JAVA_HOME:
$sudo bash -c "echo JAVA_HOME=/usr/lib/jvm/java-6-sun/ >> /etc/environment"
Log out and log back in again and you can see that JAVA_HOME is set by executing:
$echo $JAVA_HOME
May 21, 2010
Ángel Medinilla
In Mac OS you can also check your java installation by
# java -version
And you can set JAVA_HOME to:
# export JAVA_HOME=`/usr/libexec/java_home`
You can also add this command to ~./.profile so it gets executed everytime you log in.
Hope it helps :)
Sep 22, 2010
Anonymous
As of Lucid 10.4, Sun Java has been moved to the partner repository. You must do this before installing sun-java6-jdk:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
Feb 14, 2011
Anonymous
I've installed JDK in this path (Debian 6 squeeze):
Then I went to /etc/profile to put the following line at the end of the file
Then I saved the file and ran the following comand:
Just to be sure I restarted my machine and I could check that the installation was OK running the following command:
So I could check Java was installed properly
Mar 18, 2011
Anonymous
I run SUSE 10
I have JAVA_HOME set to JDK 5.0 .
I need that JAVA_HOME point to JDK6.0.
How I will do that?
Mar 23, 2011
Anonymous
In a fresh install of Ubuntu 10.04 64bit, add-apt-repository is not installed by default... try:
> sudo aptitude install python-software-properties
> sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
> sudo aptitude update
> sudo aptitude install sun-java6-jdk
Replace aptitude with apt-get if so desired (use one or the other)
Apr 27, 2011
Whit Blauvelt
More complete instructions for Ubuntu 10.04 and 10.10 are here:
http://java.dzone.com/articles/sun-java-6-ubuntu-1004-1010?utm_source=am6_feedtweet&utm_medium=twitter&utm_campaign=toya256ForRSS
Also, the add-apt-repository command is installed as part of the python-software-properties package, which may need to be installed first.
Sep 22, 2011
Anonymous
I have read in the documentation elsewhere that the JDK is necessary?
I also note that the new JIRA installer installs another jre instance.
Does JIRA now use the cacerts file in this jre?
Surely there is some redundancy here?
Oct 27, 2011
Giles Gaskell [Atlassian Technical Writer]
Hello there,
Only a JRE is necessary to run JIRA, although if you're building JIRA from source, a JDK is required. If you've read elsewhere on this site that a JDK is required to run JIRA, please let us know so we can correct our documentation.
That's true, the new installers (available from JIRA 4.4) for Windows and Linux install their own JREs.
I asked one of my colleagues these questions, to which the response was 'JIRA will use the cacerts file in these JREs. While this situation may provide some redundancy, having a bundled JRE in these installers simplifies the JIRA installation and configuration process, which is the core purpose of these installers.'
Cheers,
Giles.
Sep 26, 2011
Anonymous
Giles quoting colleagues said:
"simplifies the JIRA installation and configuration process, which is the core purpose of these installers"
Thanks for the response on these points regarding the JDK/JRE roles and functions Giles but I am even more confused if that is possible because most of this page is devoted to installing Java and setting JAVA_HOME to point to it.
Taking your word as gospel then I would expect to find a warning or documentation prompting the administrator to abandon the unnecessary/ potential harmful installation of a separate jdk/jre as well as the importation of certificates to that truststore/cacerts file rather than a procedures on how to provide redundancy.
I must be going loopy...
Redundancy is one thing but conflict is quite another!
Oct 04, 2011
Anonymous
^Much agreed with the above comments. You shouldn't instruct people to install and configure Java if its bundled.
In addition, after upgrading from 4.2.2 to 4.4.1 on Win2008 when I try to start JIRA I receive the following litany of errors which contradict the claim that JD is not required:
You have Issues!...
JAVA_HOME "c:\Program Files (x86)\Java\jre6" contains spaces. Please change to a location without spances if this causes problems.
...
The JAVA_HOME environment variable is not defined correctly
The environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE
Oct 27, 2011
Giles Gaskell [Atlassian Technical Writer]
Hello there,
Apologies for the confusion caused and thanks very much for highlighting this issue.
We've made the note at the top of this page more prominent now, instructing people who intend to use the Windows and Linux Installers (to install JIRA) to ignore the instructions on this page.
Furthermore, the Java section of the JIRA Requirements page has been amended to clarify which JIRA installers require you to install a Java platform beforehand and which installers don't.
As for the issue you mentioned here:
You might encounter this issue if you already had a Java platform installed on your OS, then used the Windows Installer to install JIRA and started JIRA from the command prompt.
Have you tried starting JIRA using the shortcuts available from the Windows 'Start Menu' which might avoid this known issue in JIRA 4.4 (JRA-25632)?
Cheers,
Giles.
Dec 12, 2011
Rob K
A marked disadvantage to the bundled JRE is that you're taking the application out of band of all the regular updates and QA of the OS bundled JDK. For example, I have Oracle/Sun Java 1.6.0_29 happily installed on my Jira server, but the bundled version is _26, and thus is missing tzdata updates for Western Australia. It would be excellent if the installer version could be made aware of system Java, and run some sanity checks before installing.
Add Comment