brew/docs/Homebrew-and-Java.md
Issy Long 31d7bcc583
Add a last_reviewed_date to docs metadata
- At the AGM we formed an ad-hoc documentation working group.
- One of our ideas was that we should have a last reviewed date for
  documentation, so that we can periodically implement a review
  mechanism (GitHub Actions posts to Slack for a regular documentation
  outdatedness check?) to track how old docs are and ensure they're
  still relevant.
- This is a first step towards that goal, by adding a `last_review_date`
  to the metadata of all docs with a date of earlier than Homebrew's
  inception because everything needs reviewing so that we start from a
  good base!
2025-02-03 11:56:07 +00:00

14 lines
932 B
Markdown

---
last_review_date: "1970-01-01"
---
# Homebrew and Java
This page describes how Java is handled in Homebrew for users. Prospective formula authors may refer to existing Java-based formulae for examples of how to install packages written in Java via Homebrew, or visit the [Homebrew discussion forum](https://github.com/orgs/Homebrew/discussions) to seek guidance for their specific situation.
Most Java-based packages in Homebrew use the default Homebrew-provided `openjdk` package for their JDK dependency, although some packages with specific version requirements may use a versioned package such as `openjdk@8`.
## Executing commands using a different JDK
In situations where the user wants to override the use of the Homebrew-provided JDK, setting the `JAVA_HOME` environment variable will cause the specified location to be used as the Java home directory instead of the version of `openjdk` specified as a dependency.