Java: configuration locations on Windows and switching version on Linux
Java registry keys and deployment folder on Windows, and commands to switch the Java version on Linux and Arch Linux.
A memo on where Java keeps its configuration and cache on Windows, and how to switch the Java version on Linux.
Windows: registry keys and deployment folder
| Location | Content |
|---|---|
HKEY_CURRENT_USER\Software\JavaSoft |
Java settings of the current user |
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft |
Machine-wide Java settings (64-bit Java) |
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\JavaSoft |
Machine-wide Java settings (32-bit Java on 64-bit Windows) |
C:\Windows\Sun\Java\Deployment |
Java deployment folder |
These locations are useful to diagnose or clean up a misbehaving Java installation (wrong version detected, leftover configuration).
Linux: switching the Java version
On distributions that use alternatives (RHEL, CentOS, Fedora...):
sudo alternatives --config java
The command lists the installed versions and asks which one to use by default.
On Arch Linux:
archlinux-java status
This shows the installed Java environments and the active one (archlinux-java set <name> selects another).