Skip to content

Clarify JAVA_HOME and PATH setup in README #841

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chiranjib-swain
Copy link

Description:
This pull request updates the documentation in the README.md file to clarify how to set up a specific Java version when multiple JDKs are installed.

  • README.md: Added instructions for updating the JAVA_HOME environment variable and prepending the desired JDK's bin directory to the PATH to prioritize a specific Java version.

Related issue:
#835

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@Copilot Copilot AI review requested due to automatic review settings May 23, 2025 06:37
@chiranjib-swain chiranjib-swain requested a review from a team as a code owner May 23, 2025 06:37
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the README with explicit steps to prioritize a specific JDK by configuring JAVA_HOME and updating PATH.

  • Adds guidance on updating the JAVA_HOME environment variable and prepending its bin directory to PATH for version precedence.

Comment on lines +238 to 239
All versions are added to the PATH. The last version will be used and available globally. Other Java versions can be accessed through env variables with such specification as 'JAVA_HOME_{{ MAJOR_VERSION }}_{{ ARCHITECTURE }}'. To set up a specific Java version, update the JAVA_HOME environment variable and prepend its bin directory to the PATH to ensure the desired JDK takes priority during execution.

Copy link
Preview

Copilot AI May 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider wrapping environment variables like JAVA_HOME and PATH in code formatting for consistency, and include example shell commands (e.g., export JAVA_HOME=/path/to/jdk; export PATH="$JAVA_HOME/bin:$PATH") to make the instructions more actionable.

Suggested change
All versions are added to the PATH. The last version will be used and available globally. Other Java versions can be accessed through env variables with such specification as 'JAVA_HOME_{{ MAJOR_VERSION }}_{{ ARCHITECTURE }}'. To set up a specific Java version, update the JAVA_HOME environment variable and prepend its bin directory to the PATH to ensure the desired JDK takes priority during execution.
All versions are added to the `PATH`. The last version will be used and available globally. Other Java versions can be accessed through environment variables with such specification as `JAVA_HOME_{{ MAJOR_VERSION }}_{{ ARCHITECTURE }}`. To set up a specific Java version, update the `JAVA_HOME` environment variable and prepend its `bin` directory to the `PATH` to ensure the desired JDK takes priority during execution. For example:
```sh
export JAVA_HOME=/path/to/specific/jdk
export PATH="$JAVA_HOME/bin:$PATH"

Copilot uses AI. Check for mistakes.

@@ -235,7 +235,7 @@ jobs:

### Install multiple JDKs

All versions are added to the PATH. The last version will be used and available globally. Other Java versions can be accessed through env variables with such specification as 'JAVA_HOME_{{ MAJOR_VERSION }}_{{ ARCHITECTURE }}'.
All versions are added to the PATH. The last version will be used and available globally. Other Java versions can be accessed through env variables with such specification as 'JAVA_HOME_{{ MAJOR_VERSION }}_{{ ARCHITECTURE }}'. To set up a specific Java version, update the JAVA_HOME environment variable and prepend its bin directory to the PATH to ensure the desired JDK takes priority during execution.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The term “last version” could be clarified (e.g., “the last one added to the PATH”).

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

Successfully merging this pull request may close these issues.

2 participants