Skip to content

[BUG] Gradle fails to find a Java compiler on Raspberry Pi 4/CM4 #7263

@megatog615

Description

@megatog615

Describe the bug
Trying to compile PCGen git on my CM4-based device on Raspberry Pi OS/testing(which is basically Debian aarch64), gradlew build fails trying to find a Java installation despite having openjdk-21-jdk(-headless) installed locally.

To Reproduce
Steps to reproduce the behavior:

  1. Install Raspberry Pi OS on a Raspberry Pi (or virtual machine)
  2. Switch to testing (change 'bookworm' to 'testing' in /etc/apt/sources)
  3. apt update
  4. apt install openjdk-21-jdk-headless
  5. get the pcgen git sources
  6. ./gradlew

Expected behavior
I expected gradle to use openjdk 21 to compile fine, or download the appropriate toolchain if it needed to as I am used to it doing in the past.

Log

FAILURE: Build failed with an exception.

* Where:
Build file '/home/***/src/git/pcgen/build.gradle' line: 306

* What went wrong:
A problem occurred evaluating root project 'pcgen'.
> Could not resolve all dependencies for configuration ':runtimeClasspath'.
   > Failed to calculate the value of task ':compileJava' property 'javaCompiler'.
      > Cannot find a Java installation on your machine matching this tasks requirements: {languageVersion=21, vendor=any vendor, implementation=vendor-specific} for LINUX on aarch64.
         > No locally installed toolchains match and toolchain download repositories have not been configured.

* Try:
> Learn more about toolchain auto-detection at https://docs.gradle.org/8.10.2/userguide/toolchains.html#sec:auto_detection.
> Learn more about toolchain repositories at https://docs.gradle.org/8.10.2/userguide/toolchains.html#sub:download_repositories.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 3s
[2:28 PM]

Desktop:

  • OS: Raspberry Pi OS testing
  • Raspberry Pi Compute Module 4

Additional context
./gradlew downloadJRE also fails with the same error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions