Getting "Compilation Error: No compiler is provided", but Maven and Atlas Java homes both set to JDK

Trevor Thackston March 31, 2016

I'm trying to follow this tutorial, but when I try to build even the skeleton generated by atlas-create-jira-plugin, I get the following compilation error:

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on
a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.594 s
[INFO] Finished at: 2016-03-31T11:55:43-06:00
[INFO] Final Memory: 21M/360M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.
5.1:compile (default-compile) on project MyViewTab: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on
a JRE rather than a JDK?
[ERROR] -> [Help 1]

But Atlas sees Java home as a JDK:

C:\development\workspaces\branch\MyViewTab>atlas-version
ATLAS Version:    6.2.2
ATLAS Home:       C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.2
ATLAS Scripts:    C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.2\bin
ATLAS Maven Home: C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.2\apache-ma
ven-3.2.1
AMPS Version:     6.2.1
--------
Executing: "C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.2\apache-maven-3.
2.1\bin\mvn.bat" --version -gs C:\Applications\Atlassian\atlassian-plugin-sdk-6.
2.2\apache-maven-3.2.1/conf/settings.xml
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; sup
port was removed in 8.0
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T11:37:5
2-06:00)
Maven home: C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.2\apache-maven-3.
2.1\bin\..
Java version: 1.8.0_72, vendor: Oracle Corporation
Java home: C:\development\environments\Java\jdk1.8.0_72
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"

And so does Maven:

C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.2\apache-maven-3.2.1\bin>mvn
-version
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T11:37:5
2-06:00)
Maven home: C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.2\apache-maven-3.
2.1\bin\..
Java version: 1.8.0_72, vendor: Oracle Corporation
Java home: C:\development\environments\Java\jdk1.8.0_72
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"

So I'm not sure where the problem here is coming from. Does anyone have any experience with this issue and know where else there might be a configuration error that could lead to this? I am on Windows 7; my JAVA_HOME environment variable is set to "C:\development\environments\Java\jdk1.8.0_72".

4 answers

1 accepted

5 votes
Answer accepted
Trevor Thackston April 1, 2016

The error, should anyone else come across this, is that my JRE install had managed to overwrite my JDK's /bin folder. To verify if your issue is coming from the same problem, try executing javac -version and see what happens. If javac doesn't exist or looks like it's too early of a version, reinstall the JDK and make sure you're not installing the JRE over it when you're prompted to install the JRE afterwards.

Derek White April 30, 2020

FYI: This is 100% user error. I did it too, so don't feel bad.

If you follow the instructions (https://developer.atlassian.com/server/framework/atlassian-sdk/install-the-atlassian-sdk-on-a-windows-system/) they clearly indicate that you should have this set PRIOR to installing the SDK.

The fact that, as a side-effect of not having it pre-set, the SDK will set it to the JRE is 100% a problem on Atlassian's side that they should still resolve.

IMO, the installer should hard fail if it is not set.

Like # people like this
2 votes
Miles Monty May 2, 2017

I've just come across this exact error in the create jira plugin use case, but reinstalling the JDK doesn't fix it. There are two separate folders with respective bin folders. 

jdk1.8.0_131

jre1.8.0_131

Chris Pearson June 30, 2017

Hi Miles. I saw this as well; in my case there were two JAVA_HOME variables.  One was a user variable and one was a system variable. The user variable pointed towards the Atlassian SDK (C:\Applications\Atlassian\atlassian-plugin-sdk-6.2.14\jre)  while the system variable pointed towards the jdk1.8.0_131 (C:\Program Files\Java\jdk1.8.0_131). 

Rather than deleting the user variable, i updated it to point to the java path instead of the Atlassian path.

This resolved my issue.

Like # people like this
stevemanderson July 14, 2017

This was my issue. Thanks for this.

Josh Lyon February 21, 2018

Thanks for sharing your comment, @Chris Pearson - I had the same issue and ended up deleting the user variable (which pointed to the JRE) as I had just recently created a system variable pointing to the JDK.

Like # people like this
Prasanth GRN November 23, 2019

I moved the java bin path to the starting of the PATH environment variable in System and User Variables.  Initially, only the system variable was updated as per atlas docs.  But after setting the user variable, I was able to run the atlas command without issue (atlas-run).  Thanks Chris for your suggestion.  It made me to update the user PATH. variable. Chris Pearson

Joaquin Benavides May 26, 2020

Thank Chris Pearson, that solved the issue.

Atlassian should fix this.

1 vote
Jens Kisters //SeibertSolutions
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 21, 2018

I just noticed that the Atlassian SDK installer also overwrites the JAVA_HOME with an path pointing to its own JRE

Derek White November 14, 2019

This is exactly what I came here to report. This is atrocious.

This is the 3rd issue I have found with the SDK on Windows today. Some of them have existed for over 2 years. (I just started using it today.)

My experience thus far has been extremely frustrating and demoralizing. Atlassian is going down. Fast.

Derek White November 14, 2019

Not that I have any hope of it being fixed, but I created an issue: https://ecosystem.atlassian.net/browse/ATLASSDK-191

Please vote/watch/add your opinion to it.

Like # people like this
Tim Black April 8, 2020

@Jens Kisters //SeibertSolutions @Derek White How to work around this? I'm using win10, have set system env variable JAVA_HOME to my JDK install dir: C:\Program Files\AdoptOpenJDK\jdk-8.0.242.08-hotspot, yet even after a reboot, I still get:

PS C:\Users\tblack> echo $Env:JAVA_HOME
C:\Applications\Atlassian\atlassian-plugin-sdk-8.0.16\jre
Like Ignat likes this
Tim Black April 16, 2020

FWIW, my workaround is to use Linux for Atlassian Development.  

Derek White April 30, 2020

@Tim BlackI would only guess to check system env vars, user env vars, and a reboot.

I also switched to Linux. A co-worker was able to use Windows 10 after a few fixes to the scripts, so I do know it is possible.

Ignat April 3, 2022

@Derek White 

to check system env vars, user env vars, and a reboot.

- that helped in my case (after reboot). Thanks

0 votes
Christopher Ramos March 4, 2022

I've come from the future to relay that @Chris Pearsonsolution is still on the money.

Suggest an answer

Log in or Sign up to answer