JAVA_HOME variable not matching with cmd

Dear Atlassian community,

I am attempt to develop a plugin for JIRA. After installing the JIRA jdk, I am coming up with this problem. The cmd prompt tells me that my JAVA_HOME is set to an incompatible environment, even though it says otherwise in my environment variables.

Thanks,
Kevin

Hi @kevin.yin, if you open a fresh cmd prompt and run

C:\Users\kevin.yin>javac -version

You should get javac 1.8.0_something if your JAVA_HOME is OK. This document applies and may assist: https://developer.atlassian.com/docs/getting-started/set-up-the-atlassian-plugin-sdk-and-build-a-project/install-the-atlassian-sdk-on-a-windows-system

1 Like

Hi nwade,

When I enter “javac -version” it correctly presents me with the current version. I have also followed that guide, but when I type in atlas-version, it says that my JAVA_HOME = "C:\Applications\Atlassian\atlassian-plugin-sdk 6.2.14\jre, as seen in the picture below. What is causing Atlas to look elsewhere for my Java home when it is clearly defined as elsewhere in my environment variables?

Hi @kevin.yin, in your first screenshot I see the echo command returns the wrong JAVA_HOME;

In my test environment this returns

The atlas-version (and other atlas- commands) will just see the same variable as reported by echo %JAVA_HOME% command, so if you can get that corrected you should be all set. What I find on my Windows test computers is that I need to set them and then restart cmd.exe. I tend to set the JAVA_HOME and Path in my system variables only.

Dear nwade,

Thank you for your help. Yes, I think that is the core of the issue I am trying to figure out. My command prompt seems to be looking in “C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.14\jre” for the JAVA home, when it is clearly set in my environment variables as “C:\Program Files\Java\jdk.1.8.0_144”. Perhaps I am configuring something incorrectly? I am just not sure of any other ways to change where the computer looks for JAVA home other than the environment variables, which are already correctly configured. I have tried resetting my computer and cmd.exe, as well.

I was just browsing through this - https://superuser.com/a/625777 - it might be worth checking both sets of registry keys detailed there (user and system), in case something is up with your computer’s ability to save those variables?

Is the Atlassian SDK installer changing the variable during installation? I think it almost has to be, because I run in to the same problem, and when I go back to the system variables, it has changed. I could not have entered it incorrectly because when I set it the Atlassian SDK directory didn’t even exist.