Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
megatog615 opened this issue Jan 27, 2025 · 3 comments
Open

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

megatog615 opened this issue Jan 27, 2025 · 3 comments
Labels

Comments

@megatog615
Copy link
Contributor

megatog615 commented Jan 27, 2025

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.

@megatog615 megatog615 added the bug label Jan 27, 2025
@karianna
Copy link
Contributor

That seems like a core Gradle env detection bug, have you reported this to them?

@megatog615
Copy link
Contributor Author

No. By the way, I noticed that inside of /usr/lib/jvm there is java-21-openjdk-arm64 but not java-21-openjdk-aarch64. AFAIK aarch64 and arm64 are the same thing so I made a symbolic link changing arm64 to aarch64 and gradlew actually makes it past. So this is definitely a bug. Not sure if a workaround can be used in the PCGen gradle config files.

Didn't finish compiling though but still, that's progress.

@megatog615
Copy link
Contributor Author

There is indeed an issue for this for Gradle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants