🌍 Jenv-JDK管理神器
2025年9月13日大约 2 分钟WindowsWindows
介绍
提示
jenv-for-windows是Windows平台的JDK管理工具,简化JDK版本切换。安装后通过命令管理JDK路径,支持列出和切换JDK版本,提升开发效率。
安装与配置
- 下载安装包
工具 | 下载地址 |
---|---|
jenv-for-windows | https://github.com/FelixSelter/JEnv-for-Windows/releases |
- 解压缩到指定目录

- 添加系统环境变量

- 验证是否安装成功

注意事项
- 问题: windwos安装jenv报错无法加载文件 D:\Develop\JEnv\xxxx.ps1。未对文件 xxxjenv.ps1 进行数字签名。无法在当前系统上运行该脚本
解决办法:
1. 打开 PowerShell (管理员权限)
2. 运行 `Set-ExecutionPolicy RemoteSigned`
3. 运行 `Get-ExecutionPolicy`
4. 输入 `Y` 或者 `A`
5. 运行 `jenv -h`
使用教程
打开 CMD
/PowerShell
通过 jenv -h
查看具体命令行教程
C:\Users\him>jenv -h
JEnv is changing your environment variables. This process could take longer but it happens only when a jenv executable is found in your path
JEnv wants to change your system environment vars. Therefore you need to restart it with administration rights. This should only once be required. If you dont want to, you have to call JEnv on every terminal opening to change your session vars
"jenv list" List all registered Java-Envs.
"jenv add <name> <path>" Adds a new Java-Version to JEnv which can be refferenced by the given name
"jenv remove <name>" Removes the specified Java-Version from JEnv
"jenv change <name>" Applys the given Java-Version globaly for all restarted shells and this one
"jenv use <name>" Applys the given Java-Version locally for the current shell
"jenv local <name>" Will use the given Java-Version whenever in this folder. Will set the Java-version for all subfolders as well
"jenv link <executable>" Creates shortcuts for executables inside JAVA_HOME. For example "javac"
"jenv uninstall <name>" Deletes JEnv and restores the specified java version to the system. You may keep your config file
"jenv autoscan [--yes|-y] ?<path>?" Will scan the given path for java installations and ask to add them to JEnv. Path is optional and "--yes|-y" accepts defaults.
Get help for individual commands using "jenv <list/add/remove/change/use/local> --help"
C:\Users\him>
添加 Java8 环境
jenv add 8 "D:\Develop\Java\jdk1.8.0_131"
添加 Java17 环境
jenv add 17 "D:\Develop\Java\jdk-17.0.4.1"
切换 Java 版本
jenv change 17
验证结果
jenv list
java -version