A version manager for Java SDKs.
The aim is to allow a quick and convenient management of Java workspace environment.
The following operating systems (OS) are supported:
- Linux
- MacOS
- Windows
The following SDK vendors (providers) are supported:
The list can be expanded.
- Check Releases page to download appropriate file.
- Unpack installation archive to
$HOMEdirectory. - Add
$HOME/.javamanto$PATHenvironment variable for availability to runjavamanuser (system) wide.
File $HOME/.javaman/config.toml contains many configuration options.
# List of SDK providers.
vendors = ["corretto", "microsoft", "openjdk"]
# Directory where SDK archives are downloaded.
# Can be absolute or relative path.
download_dir = "./downloads"
# Directory where SDKs are installed.
# Typically, it is a part of JAVA_HOME env.
# Can be absolute or relative path.
install_dir = "./sdks"
# Max versions number to show in list.
list_limit = 20
# File with list of cached SDKs in JSON format.
list_cache_file = "./cache.json"
# Cache expiration time in minutes.
list_cache_ttl = 1440
# Defines in which file is added loading config string.
# Non-windows property.
# Examples: ~/.profile, ~/.bashrc, ~/.zshrc, etc.
unix_shell_config = "~/.profile"The following is shown if javaman --help executed:
Usage:
javaman [flags]
javaman [command]
Available Commands:
default Set specified Java version as default
download Download specified Java version
help Help about any command
install Install specified Java version
list Shows list of available Java versions
remove Remove specified Java version
version Shows version of javaman
Flags:
-h, --help help for javaman
Use "javaman [command] --help" for more information about a command.
For example, let's add Java new version.
- Show available versions list:
javaman list
microsoft-21.0.3 windows x64
microsoft-21.0.2 windows x64
microsoft-21.0.1 windows x64
microsoft-21.0.0 windows x64
microsoft-17.0.15 windows x64
microsoft-17.0.14 windows x64
...
- Install specific version by executing
javaman install microsoft-21.0.3command.
SDK has been installed: /home/user/.javaman/sdks/microsoft-21.0.3
- Set installed version as default one by
javaman default microsoft-21.0.3command.
User environment is set to microsoft-21.0.3 version as default
-
(Important!) Reopen terminal to pick changes up.
-
Check versions list again to see the asterisk near the default one with
javaman listcommand.
* microsoft-21.0.3 windows x64 [downloaded] [installed]
microsoft-21.0.2 windows x64
microsoft-21.0.1 windows x64
microsoft-21.0.0 windows x64
microsoft-17.0.15 windows x64
microsoft-17.0.14 windows x64
...
- Verify everything is expected with
java -version && echo $JAVA_HOME && echo $PATHcommand.
OpenJDK version "21.0.3"
OpenJDK Runtime Environment Microsoft
OpenJDK 64-Bit Server VM Microsoft
/home/user/.javaman/sdks/microsoft-21.0.3
...;/home/user/.javaman/sdks/microsoft-21.0.3/bin
- Verify specified SDK version is available.
- Download SDK archive from vendor page.
- Extract archive to
{install_dir}/{version}directory. - Set or update
JAVA_HOMEenvironment variable. - Add
JAVA_HOME/bintoPATHenvironment variable.
This project was fully inspired by SDKMAN! but author required native support for Windows.
The same results can be achieved by using Windows Package Manager such as WinGet or similar.
The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. in no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
If you have any ideas or inspiration for contributing the project, please create an issue or a pull request.