MyJavaManager is a PowerShell module that helps you to manage versions of Java on your system.
Available features:
- Keep in track Java versions in an inventory (i.e. JSON file)
- Easily switch between java versions (set the
JAVA_HOME
environment variable) - Automatically download and install Java package from https://adoptium.net/ (previously https://adoptopenjdk.net/)
MyJavaManager is released under the terms of the MIT license.
See LICENSE for more information or see https://opensource.org/licenses/MIT.
To install the PowerShell module, follow one of these methods:
The module supports the following PowerShell versions:
- PowerShell Desktop 5.1
- PowerShell Core 6 and later
Get the latest version of PowerShell from the official PowerShell repository.
The module is published on PowerShell Gallery.
See https://www.powershellgallery.com/packages/MyJavaManager.
To install it, run:
Install-Module -Name MyJavaManager -Repository PSGallery
Download MyJavaManager.zip
from the "Releases" page.
Extract it in C:\Users\<your_user>\Documents\PowerShell\Modules\
.
-
Unblock downloaded scripts (optional)
Get-ChildItem -Filter *.ps1 | Unblock-File
-
Build the module
.\build.ps1 build -Bootstrap
-
Remove any old versions of the module
Remove-Item "$HOME\Documents\PowerShell\Modules\MyJavaManager" -Force
-
Install the freshly built module
Copy-Item ".\Out\MyJavaManager" "$HOME\Documents\PowerShell\Modules\" -Recurse
-
Import the module
Import-Module -Name MyJavaManager
-
Get the available commands
Get-Command -Module MyJavaManager
The fastest way to use the module is to import it from your PowerShell profile. Then, each time you will open your PowerShell console, the module will be automatically imported.
Read help files in docs/cmdlet-help.
You can also use the Get-Help
Cmdlet to obtain more information about a command.
If you have any bug reports, log them on the issue tracker.
If you have some suggestions, please don't hesitate to contact me (find email on my GitHub profile).