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

Java "11" is not required (especially for Windows) #23882

Open
tats-u opened this issue Oct 6, 2024 · 7 comments
Open

Java "11" is not required (especially for Windows) #23882

tats-u opened this issue Oct 6, 2024 · 7 comments
Labels
area-Windows Windows-specific issues and feature requests help wanted Someone outside the Bazel team could own this P2 We'll consider working on this in future. (Assignee optional) team-Documentation Documentation improvements that cannot be directly linked to other team labels team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: documentation (cleanup)

Comments

@tats-u
Copy link

tats-u commented Oct 6, 2024

Page link:

https://bazel.build/install/windows#install-compilers

Problem description (include actual vs expected text, if applicable):

* [Java SE Development Kit 11 (JDK) for Windows x64](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html){: .external}{:#install-jdk}

This line is incorrect and confused me a lot. It should be removed.

google/mozc#932 (comment)

Bazel for Windows these days automatically installs Zulu 21.

image

 tatsu@TATSU-DPC-2ND  ~\..\..\..\..\..\bin  ./java --version
openjdk 21 2023-09-19
OpenJDK Runtime Environment Zulu21.28+85-CA (build 21+35)
OpenJDK 64-Bit Server VM Zulu21.28+85-CA (build 21+35, mixed mode)
 tatsu@TATSU-DPC-2ND  ~\..\..\..\..\..\bin  java --version
openjdk 21.0.3 2024-04-16 LTS
OpenJDK Runtime Environment Temurin-21.0.3+9 (build 21.0.3+9-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.3+9 (build 21.0.3+9-LTS, mixed mode, sharing)
 tatsu@TATSU-DPC-2ND  ~\..\..\..\..\..\bin  bazel --version
bazel 7.3.2

Where do you see this issue? (include link to specific section of the page, if applicable)

No response

Any other information you'd like to share?

Python "3.6" is a stale information too.

@tats-u tats-u added team-Documentation Documentation improvements that cannot be directly linked to other team labels type: documentation (cleanup) untriaged labels Oct 6, 2024
@fmeum
Copy link
Collaborator

fmeum commented Oct 6, 2024

Would you be interested in sending a PR?

@tats-u
Copy link
Author

tats-u commented Oct 6, 2024

Not now or in this week.
It's a bad idea to expect too much from my contribution.
If I were a member, I would remove the JDK entry. Do you agree with it?

@yukawa
Copy link

yukawa commented Oct 6, 2024

If I were a member, I would remove the JDK entry. Do you agree with it?

Sorry, my comment at google/mozc#932 (comment)_ might have been misleading.

I was trying to explain that running Bazel itself would not require any explicit installation of Java Runtime Environment (JRE) these days, while the installation document looks to be saying that an explicit explicit installation of Java Development Kit (JDK) will be needed to build code written in Java by using Bazel, which I believe is still valid (except for which JDK version should be installed most likely depends on the target project you want to build).

* [Java SE Development Kit 11 (JDK) for Windows x64](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html){: .external}{:#install-jdk}
You will need this to build Java code on Windows.
Also supported: Java 8, 9, and 10

If I were a member, I would remove the JDK entry. Do you agree with it?

In google/mozc#932 the reporter did not need to install JDK because the project that the reporter was trying to build a project (for Windows) did not have any Java build target. This does not mean that JDK is completely unnecessary to build other projects that need to build Java source code. So removing JDK entry may also cause another confusion. Just fyi.

@tats-u
Copy link
Author

tats-u commented Oct 6, 2024

Thank you for the additional explanation. We might verify whether the installation of JDK is really unnecessary using Sandbox or VM.

@sgowroji sgowroji added area-Windows Windows-specific issues and feature requests team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website labels Oct 7, 2024
@meteorcloudy meteorcloudy added P2 We'll consider working on this in future. (Assignee optional) help wanted Someone outside the Bazel team could own this and removed untriaged labels Oct 8, 2024
@tats-u
Copy link
Author

tats-u commented Oct 13, 2024

I uninstalled MSYS2, Bazel, and Java 21 (Eclipse Temurin), and reinstalled only MSYS2 and Bazel via Scoop.
Then I set up MSYS2 by the msys2 command.
After that I ran in the src directory of Mozc:

bazel clean
bazel --bazelrc=windows.bazelrc build --config oss_windows --config release_build package

Bazel is successfully compiling C++ source code files without a local JDK.
This shouw we don't need a local JDK in Windows.

@yukawa
Copy link

yukawa commented Oct 13, 2024

This shouw we don't need a local JDK in Windows.

Right. You don't need JDK as long as Mozc is the only project you want to build with Bazel.

https://bazel.build/install/windows#install-compilers is actually saying that what additional tools are needed depend on what you want to build.

Depending on which languages you want to build, you will need:

In other words, you can use Bazel without installing Visual C++ Build Tools and Windows 10 SDK. Bazel itself can run without them, but the build may or may not fail depending on the target project requirements. And as for Mozc, the build will actually fail on Windows.

If you happened to have to build Java-based project such as Bazel itself, you would still need to install JDK, I guess.

@tats-u
Copy link
Author

tats-u commented Oct 14, 2024

Right. You don't need JDK as long as Mozc is the only project you want to build with Bazel.

I'll fix docs/build_mozc_in_windows.md in Mozc if possible.

If you happened to have to build Java-based project such as Bazel itself, you would still need to install JDK, I guess.

I see. There's a description "You will need this to build Java code on Windows.".
However I think we shouldn't write concrete versions there.
"Java SE Development Kit (JDK) for Windows x64 whose version is required by the project" is longer but might be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Windows Windows-specific issues and feature requests help wanted Someone outside the Bazel team could own this P2 We'll consider working on this in future. (Assignee optional) team-Documentation Documentation improvements that cannot be directly linked to other team labels team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: documentation (cleanup)
Projects
None yet
Development

No branches or pull requests

7 participants