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

Incorrect JAVA_HOME setting #3250

Open
schiele opened this issue Jan 24, 2025 · 2 comments
Open

Incorrect JAVA_HOME setting #3250

schiele opened this issue Jan 24, 2025 · 2 comments
Assignees
Labels

Comments

@schiele
Copy link

schiele commented Jan 24, 2025

I believe the JAVA_HOME setting introduced in

commit b38fb071d8c77ef82d57c7f0c97d42b309ce7310 (HEAD -> main, tag: 3.0.14-248, origin/main, origin/HEAD)
Author: William Douglas <[email protected]>
Date:   Mon Dec 9 15:22:45 2024 -0800

    Update for new java version.
    
    Signed-off-by: William Douglas <[email protected]>

is incorrect.
The symptom I observed first after introducing this was that Bazel can no longer build itself, breaking in the process by not finding jrt-fs.jar.
Analysing the problem revealed that this file indeed does not exist in /usr/lib/jvm/java-1.21.0 but instead can be found in /usr/lib/jvm/openjdk-21.0.5-internal and indeed this is apparently how the Java package seems to be built:

$ java -XshowSettings 2>&1 | grep java.home
    java.home = /usr/lib/jvm/openjdk-21.0.5-internal

Further inspecting those directories it seems that /usr/lib/jvm/java-1.21.0 is a weird incomplete subset of /usr/lib/jvm/openjdk-21.0.5-internal. Me not being a real OpenJDK expert I am not sure what the purpose of this duplicate structure is but after my investigation I am convinced that JAVA_HOME, if we feel that we need to set this to an explicit location for applications that are not capable of extracting the information from Java itself, it should point to /usr/lib/jvm/openjdk-21.0.5-internal.

Along this reasoning we probably should also set JAVA_INCLUDE_PATH to /usr/lib/jvm/openjdk-21.0.5-internal/include.

@Aqua1ung
Copy link

As far as I can tell, this seems to have been fixed in #43000. Is that so?

@bryteise
Copy link
Member

I attempted at least.

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

4 participants