<div style="display: none;" hidden="true" aria-hidden="true" data-nosnippet>Are you an LLM? You can read better optimized documentation at /pages/3bab56.md for this page in Markdown format</div>
电脑经常死机 重置 导致经常我们配置开发环境, 到了开发后期有时候会需要到不同版本的jdk或者node也或者其他的开发环境,
所有这篇心得就是不按照官方步骤配置开发环境, 而是通过版本管理器配置
话不多说, 教程开始
java(jdk)
版本管理器
JDK Version Manager (JVMS) for Windows https://github.com/ystyle/jvms/releases
- 下载解压 当前目录管理员运行
shell
PS D:\Env\jvm> .\jvms.exe init
set `JAVA_HOME` Environment variable to C:\Program Files\jdk
add jvms.exe to `path` Environment variable可以把 该 exe文件放到环境配置中, 这样就可以全局访问了
shell
NAME:
jvms - JDK Version Manager (JVMS) for Windows
USAGE:
jvms.exe [global options] command [command options] [arguments...]
VERSION:
2.0.3
COMMANDS:
init Initialize config file
list, ls List the JDK installations.
install, i Install remote available jdk
switch, s Switch to use the specified version.
remove, rm Remove a specific version.
rls Show a list of versions available for download.
proxy Set a proxy to use for downloads.
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help, -h show help
--version, -v print the version前端(node)
shell
PS D:\Code> nrm
nrm : 无法加载文件 C:\Program Files\nodejs\nrm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsof
t.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1
+ nrm
+ ~~~
+ CategoryInfo : SecurityError: (:) [],PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
PS C:\Windows\system32> set-ExecutionPolicy RemoteSigned
执行策略更改
执行策略可帮助你防止执行不信任的脚本。更改执行策略可能会产生安全风险,如 https:/go.microsoft.com/fwlink/?LinkID=135170
中的 about_Execution_Policies 帮助主题所述。是否要更改执行策略?
[Y] 是(Y) [A] 全是(A) [N] 否(N) [L] 全否(L) [S] 暂停(S) [?] 帮助 (默认值为“N”): Y