Unable to build with Bamboo Specs due to error "No compiler is provided in this environment"

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Problem

When Maven is pointing to a Java path that doesn't include compilers, Bamboo specs will not run and will produce an error as described below

1 2 3 4 5 20-Jul-2020 15:34:42 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project bamboo-specs-generator: Compilation failure 20-Jul-2020 15:34:42 [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? 20-Jul-2020 15:34:42 [ERROR] -> [Help 1] 20-Jul-2020 15:34:42 org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project bamboo-specs-generator: Compilation failure 20-Jul-2020 15:34:42 No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

Diagnosis

Environment

  • Bamboo Server

  • Maven

You can confirm what version/location of Java is being used by Maven as in the example below

1 2 3 4 5 6 mvn --version Apache Maven 3.6.0 Maven home: /usr/share/maven Java version: 1.8.0_221, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-8-oracle/jre Default locale: en_US, platform encoding: ANSI_X3.4-1968 OS name: "linux", version: "4.15.0-72-generic", arch: "amd64", family: "unix"

Cause

$JAVA_HOME is not pointing to a path with a JAVA compiler (JDK)

Solution

Resolution

Make sure $JAVA_HOME variable is pointing to a Java JDK path.

Updated on April 11, 2025

Still need help?

The Atlassian Community is here for you.