Unable to build community edition on Windows 11: Cannot find a Java installation

I’ve installed open jdk 11, set JAVA_HOME and add java bin path to %PATH%. Then I open a command prompt window and run this command: gradlew hivemqZip.

This is what I get and seems like it complains jdk is not found:

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not resolve all dependencies for configuration ‘:buildSrc:buildScriptClasspath’.

Could not resolve project :buildSrc.
Required by:
project :buildSrc
Failed to calculate the value of task ‘:buildSrc:compileJava’ property ‘javaCompiler’.
Cannot find a Java installation on your machine matching this tasks requirements: {languageVersion=8, vendor=any vendor, implementation=vendor-specific} for WINDOWS on x86_64.
No locally installed toolchains match and toolchain download repositories have not been configured.

BUILD FAILED in 28s

This is my java version:
java --version
openjdk 11 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)

Hi @d.boy.jq, welcome to the HiveMQ Community! :tada:

If you’re running into issues building HiveMQ CE, you can skip the build process and download the pre-built version instead:

:point_right: Download HiveMQ CE 2025.1

This way, you can start using HiveMQ right away without needing to troubleshoot the build. Let us know if you have any other questions! :blush:

Best,
Dasha from The HiveMQ Team

Thanks @Daria_H . My goal is to build HiveMQ from scratch. Is this the right place to get support for build issues? Do I need to open an issue on your Github?

Hi @d.boy.jq

Could you please download and install this OpenJDK version on your Windows computer and give it a try?

During installation, make sure to set the JAVA_HOME environment variable properly.

Kind regards,
Diego from HiveMQ Team