Linux command
jenv 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Add a JDK
jenv add [/path/to/java/home]
List installed versions
jenv versions
Show current version
jenv version
Set global Java version
jenv global [11.0.20]
Set local version for directory
jenv local [17.0.1]
Set version for current shell
jenv shell [11.0.20]
Enable a plugin
jenv enable-plugin [export]
Check configuration
jenv doctor
说明
jenv manages multiple Java JDK installations and sets JAVA_HOME automatically. It does not install JDKs itself. Version priority: shell > local > global. Use the export plugin for JAVA_HOME support. Creates .java-version files for local versions.
FAQ
What is the jenv command used for?
jenv manages multiple Java JDK installations and sets JAVA_HOME automatically. It does not install JDKs itself. Version priority: shell > local > global. Use the export plugin for JAVA_HOME support. Creates .java-version files for local versions.
How do I run a basic jenv example?
Run `jenv add [/path/to/java/home]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
Where can I find more jenv examples?
This page includes 8 examples for jenv, plus related commands for nearby Linux tasks.