Setting the JAVA_HOME Variable in Windows

This information is only relevant if you're installing Confluence on a Windows server.

After you've installed the Java Runtime Environment (JRE) in Windows, you must set the JAVA_HOME environment variable to point to the JRE installation directory.

Stage 1. Locate the JRE Installation Directory

If you already know the installation path for the Java Runtime Environment, go to Stage 2 below. Otherwise, find the installation path by following these instructions:

  1. Open the directory C:\Program Files\Java using Explorer (if you didn't change the installation path for the Java Runtime Environment during installation)
  2. Locate the appropriate subdirectory, such as C:\Program Files\Java\jre6

Stage 2. Set the JAVA_HOME Variable

Once you have identified the JRE installation path:

  1. Right-click the My Computer icon on your desktop and select Properties
  2. Click the Advanced tab
  3. Click the Environment Variables button
  4. Under System Variables, click New
  5. Enter the variable name as JAVA_HOME
  6. 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)'

  7. Click OK
  8. Click Apply Changes
  9. Close any command window which was open before you made these changes, and open a new command window.
    There's no way to reload environment variables from an active command prompt. If the changes don't take effect even after reopening the command window, restart Windows.

If you're running the Confluence EAR/WAR distribution, rather than the regular Confluence distribution, you may need to restart your application server.

Related Topics

Starting Tomcat as a Windows Service
Installing Confluence in Linux

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

33 Archived comments

  1. User avatar


    You should update scrnshots to reflect newer versions of jdk
    Or make a note of what the latest recommended version required

    Also, Java installs from Sun put things und c:/program files/java/JDK...  and /JRE...
    This is different from what you show here

    Does a path with spaces have an impact on this?

    I think that setting home variables in Win requires dos 8 char names, not sure though

    04 Sep 2008
    1. User avatar

      Tony Cheah Tong Nyee

      Hi Mark,

      Thanks for the feedback.
      The following pages provide information regarding the supported Java version for Confluence:

      To my understanding, there shouldn't be any big issue regarding path with spaces. However, it is always recommended to use 8 char names in Windows or avoid using white spaces for paths.


      20 Oct 2008
  2. User avatar


    I am trying to install Confluence in my system.I have all prerequisite softwares and database needed for installation.I am following the steps as guided in the Installation Guide.But I am getting while running the startup.bat file. It is not giving any error message in log files,but i am not getting the "welcome page" from where i am supposed to proceed for installation purpose.But yes i am getting one message saying "init unable to setup application config : no home set"..................Is my problem is because of this only?Please help me out of this problem asap.



    08 Oct 2008
    1. User avatar

      Azwandi Aris [Atlassian]

      Hi Mrinal,

      As far as I am concerned, the error message "init unable to setup application config : no home set" is normal for a fresh Confluence installation. Confluence will then proceed to create a Home Directory for Confluence. I would suggest you to raise a support request at, and attach a zip of <confluence-install>/logs, <confluence-home>/logs and advice the detailed steps that you have taken to install Confluence. Hope this helps.


      16 Oct 2008
  3. User avatar

    Azwandi Aris [Atlassian]


    It might be due to some reasons - here is a list that I think is related:

    • You have not closed all the command prompt windows. Even better, restart Windows (smile)
    • It is pointing to a JRE, not a JDK

    If that does not help, you can configure the variable for Confluence only by adding this line at the top of <conf-install>/bin/setenv.bat:


    Note that this would only work if you start up Confluence via <conf-install>/bin/startup.bat.

    Hope that helps.


    13 Jul 2009
    1. User avatar


      Ty! This one did the job!

      Instead of: C:\Progra~1\Java\jre6
      I used:C:\Progra~1\Java\jdk1.7.0_07

      03 Oct 2012
      1. User avatar

        Boris Berenberg [Atlassian]

        JDK 1.7 is not supported by Atlassian prior to JIRA 5.2: Supported Platforms

        03 Oct 2012
  4. User avatar



    Your install (atlassian-confluence-2.10.3-evaluation.exe) states that a JRE is required. Based on your documentation, it's clear that a JDK is required, plus a JAVA_PATH environment variable. Please update the install to mention these two details.


    Eric Terrell

    28 Jul 2009
  5. User avatar


    I mean a JAVA_HOME environment variable.

    28 Jul 2009
  6. User avatar

    Mitch Abramson

    Got the error message saying "JRE" during confluence install on a machine that has JRE but does not have the JDK.  Reailzing the missing JDK is the issue - went to SUN to download one, but there's more than one available.  See link shown here.  I am guessing the one that sites EE and Web 2.0 apps is the best, but really I'm just guessing.  Which JDK should users download from the list shown at this link:

    Inquiring minds would like to know ...

    23 Aug 2009
  7. User avatar


    Screen captures and directions are not very helpful for windows vista

    30 Jul 2010
  8. User avatar


    I got the same error, needed to restart windows...otherwise when you check the env variables from CMD ...SET these only showed up after restart and everything worked

    Vrezh A

    04 Aug 2010
  9. User avatar


    It's probably worth mention that Confluence instances that are installed as a windows service need to have the service removed and reinstalled in order to point the instance to a new JDK.

    22 Nov 2010
  10. User avatar


    Install both the JDK and the JRE ( on a fresh windows install ).  Create JAVA_HOME variable with the path to the JDK and the JAVA_JRE variable with the path to the JRE folder.  IE:  C:\progra~1\java\JDK_someversion as the path for JAVA_HOME and C:\progra~1\java\jre as the path for JAVA_JRE

    Make sure to set both variables, worked for me under windows 2003 R2 Ent

    29 Aug 2012
    1. User avatar

      John Proffitt

      Upon doing an in-place upgrade, I found I had to do what the commenter above suggested – set both a JAVA_HOME variable and a JAVA_JRE variable. Frustrating that it took 2 hours to finally figure this out and try it. But it worked. My settings (on Windows 2008 R2):

      • JAVA_HOME = C:\Program Files\Java\jdk1.7.0_21
      • JAVA_JRE = C:\Program Files\Java\jdk1.7.0_21\jre
      22 Apr 2013
  11. User avatar


    Thank you. Huge help!!  I was finally able install Android SDK Tools on my Windows 7 64bit system after setting new environment called JAVA_HOME point to path variable C:\Program Files\Java\jre7.  


    11 Sep 2012
    1. User avatar

      Sarah Maddox [Atlassian]

      I'm so glad these docs helped. (smile)

      12 Sep 2012
  12. User avatar


    thank u a lot it was very usefull and it worked for me

    24 Sep 2012
  13. User avatar


    This didnt help. I looked for the envriornment thingy but it wasnt there!!!

    25 Oct 2012
  14. User avatar


    Thanks man! helped me a lot! (big grin)

    28 Oct 2012
  15. User avatar

    John Proffitt

    I just followed the instructions and it worked like a charm. A little disappointed that this step is necessary – 64-bit Windows servers are the standard now – but at least I could help myself to the solution.

    11 Jan 2013
  16. User avatar




    12 May 2013
  17. User avatar


    Greats. . .it works. . .thanks a lot!. (smile)

    07 Jun 2013
  18. User avatar


    Actually there is a way to check using CMD if an environment variable has been set. There are two ways you could check.

     cd %JAVA_HOME%

    The above would show something like: 
    C:\Users\Plutonium>cd %JAVA_HOME%
    C:\Program Files (x86)\Java\jre7>

    You could also use SET J
    That would show something like:
    C:\Program Files (x86)\Java\jre7>set J

    30 Jun 2013
  19. User avatar


    Thanks (smile)

    19 Jul 2013
  20. User avatar


    I (Windoze non-expert) got no "My Computer" icon on my Windoze. Also my German Systemsteuerung seems not to have system variables.

    13 Aug 2013
  21. User avatar


    I have installed my jdk in E drive... explain the procedure to set class path with screen shots

    07 Oct 2013
  22. User avatar


    It is on Computer>Properties>Advanced System Properties ...

    13 Oct 2013
  23. User avatar



    I can't believe it was that easy! After renaming java.exe to java2.exe under /windows/system32, VIOLA!!!! Enjoy.

    08 Nov 2013
  24. User avatar


    Thanks so much, it solve my problem.

    21 Nov 2013
  25. User avatar


    try it with will take time but solved

    11 Dec 2013
  26. User avatar

    lavitz slambert

    Another quick way to achieve that is to run below line on the command prompt after you install the desired JDK version:

    "setx JAVA_HOME "C:\Program Files\Java\jdk1.7.0_79" /M"

    (info) This will work from windows server 2008 R2 to latest.

    After you run that just close and reopen your command prompt to visualize the environmental variable.

    Thanks and Regards,
    Lavitz - the guy that uses Confluence on Windows as a Hobby!

    24 Jun 2015
  27. User avatar


    Simple , But good blog.  You should add some Image or video . I also find out one good article on "JAVA_HOME" Setup here -

    12 Aug 2015
Powered by Confluence and Scroll Viewport