To get the latest and greatest features in JIRA, please upgrade to JIRA Software. Visit the Migration Hub for more information.

Installing Java on Ubuntu or Debian

Some linux distributions (notably Debian and Ubuntu) come with a free version of Java called GIJ (from the GCJ project) pre-installed:

jturner:~$ java -version
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 (Ubuntu 4.1.2-0ubuntu5)

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO

Unfortunately GCJ is incomplete, and unable to run Atlassian Java applications without problems.

The solution is to install a supported version of Java. (tick) Visit the Java download page on the Oracle web site to download a supported version of Java for your Linux distribution. Installation instructions are provided on this web site.

After doing this, make sure the correct version of Java is in use by running java -version:

jturner:~$ java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode)

If the GCJ Java is still being used, you will need to explicitly set Linux's default Java platform to a JIRA-supported (e.g. Oracle's) Java platform as the default:

jturner:~$ sudo update-alternatives --config java

There are 2 alternatives which provide `java'.

  Selection    Alternative
*         1    /usr/bin/gij-wrapper-4.1
 +        2    /usr/lib/jvm/java-6-sun/jre/bin/java

Press enter to keep the default[*], or type selection number: 2
Using `/usr/lib/jvm/java-6-sun/jre/bin/java' to provide `java'.


Some programs like Tomcat (bundled with most Atlassian products) need a JAVA_HOME variable set, so they know where Java is installed. This can be set system-wide in /etc/profile:

jturner:~$ sudo su -
root:~# cat >> /etc/profile
export JAVA_HOME

The variable will be set for new terminals:

jturner:~$ echo $JAVA_HOME

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

22 Archived comments

  1. User avatar

    James Intriglia

    Hi Jeff, Thanks for the tip on configuring Java w/Umbuntu Linux. Re: the latest release of Debian Linux (v5.03 Lenny), the sun-java6-jdk package is not available as an apt-get .deb package (not yet released). I found this information re: available JAVA packages for Debian v5.x:

    Any idea which alternate JVM/JRE would support JIRA v4? Has Atlassian verified JIRA v4 operation with FreeBSD (Unix) or another Linux distribution?

    Many thanks for you work.

    20 Oct 2009
    1. User avatar

      Andy Brook [The Plugin People]

      The problem with freeBSD is that in order get Java onto it, they've needed to build it against that platform, ie taken the source of the SUN JRE and compiled in natively on BSD. The difference is that for Linux, SUN itself produces the binaries, which is why there are issues in freeBSD support. FYI Ive been using Ubuntu for a couple of years with Jira 3.x and and am testing with Jira4, I foresee no issues.

      20 Oct 2009
      1. User avatar


        Andy, thanks for that info. I've got free BSD v7.2 installed on my Macbook Pro via a VM instance. As I just got my Debian VM instance running java-6-sun JRE, I am going to go forward with testing JIRA v4 on Debian. Good to know that JIRA 3.x runs on Ubuntu. When I installed Ubuntu Desktop v9.0.4, it was good to find that Sun Java 6 was already installed rather than the GNU GJC  version.

        P.S. Some more good info re: JIRA 4.x on Linux here:

        22 Oct 2009
  2. User avatar

    Manuel F Martinez

    Thanks Jeff for this reference.

    James, I think what you need is just edit your repositories on /etc/apt/sources.list and add non-free at the end of each repository.  By default, Debian setup only has main repository defined.

    After changes, you should be able to install sun-java6-jdk as explained here.


    31 Oct 2009
    1. User avatar

      James Intriglia


      Yes, after adding the non-free reference to my sources list, I was able to download Sun Java 6. Thanks for the tip.

      27 Nov 2009
      1. User avatar


        Hi James,

        Can you provide me your source list?

        11 May 2011
    1. User avatar

      Huw Evans (

      The specific lines in the /etc/apt/sources.list file are:

      04 Aug 2010
    1. User avatar


      the prob with me i m installing java on my ubuntu ultimate...aftre 93% installation it says unable to fetch some archives

      what should i do?

      24 Oct 2010
    1. User avatar


      Then apt-get update!

      05 Feb 2011
  3. User avatar


    Hi.. can you tell me where I can download java sun for ubuntu 9.10?
    I am a new user linux

    09 May 2010
  4. User avatar

    Aren Cambre

    Two problems:

    1. sun-java6-jdk is not available on Ubuntu 10.10. What alternate package would you recommend? There's a few.
    2. Are you sure we need the java development kit (jdk)? JDK = if you're developing a product. Java runtime engine (JRE) is what you use just to run software.

    Anything wrong with Ubuntu's default-jre package?

    05 Jul 2010
    1. User avatar

      Anil Mahadev

      Hello Aren,

      No worries. You can get the sun-java6-jdk on Ubuntu LTS 10.04. I am currently participating in the Atlassian Dragons Challenge and using Ubuntu 10.04 with Sun JDK

      1) First, click on System Menu > Administration > Software Sources

      2) Under the ,Other Software Tab, check Ubuntu Partner Repository

      3) Click Reload and issue the following command to get the JDK through Synaptic Package Manager or APT-get

      4) sudo apt-get install sun-java6-jdk and Voila :)

      Good Luck!


      06 Jul 2010
  5. User avatar



    I've some problems installing JIRA 4.4 on Ubuntu 10.4. When I run command:

    sudo ./atlassian-jira-4.4-x64.bin

    then I've got error message:

    Unpacking JRE ...
    Starting Installer ...
    /home/krzysztofku/Downloads/atlassian-jira-4.4-x64.bin.2688.dir/jre/bin/java: 1: Syntax error: "(" unexpected

    If I change shell from sh (in Ubuntu currently sh i dash) to bash and I run:

    sudo ./atlassian-jira-4.4-x64.bin

    I've got other error message:

    Unpacking JRE ...
    Starting Installer ...
    ./atlassian-jira-4.4-x64.bin: line 466: /home/krzysztofku/Downloads/atlassian-jira-4.4-x64.bin.2752.dir/jre/bin/java: cannot execute binary file

    I don't know what I can do next.

    Sorry for my poor english.

    Best regards

    05 Aug 2011
    1. User avatar


      you may be trying to use the 64 bit installer on a 32 bit system (helpful message, eh?)


      05 Aug 2011
      1. User avatar


        Thanks! (smile)

        21 Sep 2011
  6. User avatar


    Hello, I followed these instructions EXACTLY, and get as far as java -version, successfully. However, thats as far as I get. When I try to check the version number, I get, "Cannot execute binary file". I am running a 32 bit machine, and I was sure to download the 32 bit version. Any ideas?


    I am running ubuntu 10.04

    02 Jun 2012
    1. User avatar

      Andy Brook [The Plugin People]

      I actually just tried exactly this, the jdk-6u32-linux-i586.bin file appears valid but the binaries are not executable.  The option to try next is an earlier java release, unfortuantely, Oracle force a login to download, and I can vouch that password reminders are not instant (tongue)

      02 Jun 2012
  7. User avatar


    hey im trying to get sun java on linux deb. you think you can help?


    15 Dec 2012
  8. User avatar


    ahhh this has been such a headache for so long and you tutorial was the remedy I needed. Cannot thank you enough!


    24 Mar 2013
  9. User avatar

    Jeremy Swift

    Advice to install a supported JRE would seem to conflict with documentation "How to Use System JRE Instead of Embedded JRE" which states that the JIRA installer implements an embedded JRE. Please clarify

    25 Nov 2013
  10. User avatar


    07 Feb 2014
  11. User avatar

    dinis brazão

    Hi all. I installed atlassian-jira-6.2.7-x64 on a debian 7.5 server. everything went fine wit instalation but when I try to access IP:8080,nothing happens. I alredy cecked and port 8080 is open as http proxy. anyone knows how I can reach JIRA?

    BTW, I have apache installed on the server - might that be the problem?

    Thanks in advance.



    I am not sure that JIRA 6.2.7 would be the best one for my debian 7.5 server (but it was the one I got from

    22 Jun 2014
Powered by Confluence and Scroll Viewport