Skip to content

Commit 6830fdd

Browse files
committed
config/external-applications: document how java packages and alternatives work
seems to have been a fair amount of confusion about this.
1 parent 808b013 commit 6830fdd

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

src/config/external-applications.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,39 @@ instead.
2323
| Ruby | gem | `ruby-devel` |
2424
| lua | luarocks | `lua-devel` |
2525

26+
### Java
27+
28+
Void provides LTS versions of the OpenJDK development kits and runtimes.
29+
Currently, versions 8, 11, 17, and 21 are available. To run Java-based
30+
applications, install the Java Runtime Environment of the desired version. To
31+
build Java-based programs, install the Java Development Kit of the desired
32+
version (and optionally other components listed below).
33+
34+
| Void Package | Description |
35+
|------------------------|--------------------------|
36+
| `openjdkX` | Java Development Kit |
37+
| `openjdkX-jre` | Java Runtime Environment |
38+
| `openjdkX-doc` | Developer documentation |
39+
| `openjdkX-src` | Java source code |
40+
| `openjdkX-jmods` | Java modules |
41+
| `openjdkX-static-libs` | Java static libraries |
42+
43+
To facilitate installing multiple Java versions in parallel, Void's OpenJDK
44+
packages use
45+
[`xbps-alternatives(1)`](https://man.voidlinux.org/man1/xbps-alternatives.1) to
46+
select the default JDK and JRE. Each `openjdkX` package provides the `jdk`
47+
alternative group, and each `openjdkX-jre` package provides the `java`
48+
alternative group.
49+
50+
These alternative groups manage the symlinks at `/usr/lib/jvm/default-jdk` and
51+
`/usr/lib/jvm/default-jre`. These are used to set the `JAVA_HOME` environment
52+
variables and add Java utilities to your `PATH` via a profile script
53+
(`/etc/profile.d/jdk.sh`).
54+
55+
When installing a Java package for the first time, you may need to re-login or
56+
run `source /etc/profile.d/jdk.sh` in your terminal session to update these
57+
variables.
58+
2659
## Restricted Packages
2760

2861
Some packages have legal restrictions on their distribution (e.g. Discord), may

0 commit comments

Comments
 (0)