惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Darknet – Hacking Tools, Hacker News & Cyber Security
V
Vulnerabilities – Threatpost
Cloudbric
Cloudbric
G
GRAHAM CLULEY
S
Securelist
Schneier on Security
Schneier on Security
Help Net Security
Help Net Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Project Zero
Project Zero
Spread Privacy
Spread Privacy
P
Privacy International News Feed
C
Cyber Attacks, Cyber Crime and Cyber Security
Cisco Talos Blog
Cisco Talos Blog
T
Tailwind CSS Blog
博客园_首页
有赞技术团队
有赞技术团队
Simon Willison's Weblog
Simon Willison's Weblog
Stack Overflow Blog
Stack Overflow Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Latest news
Latest news
T
Tor Project blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Attack and Defense Labs
Attack and Defense Labs
www.infosecurity-magazine.com
www.infosecurity-magazine.com
O
OpenAI News
J
Java Code Geeks
T
Tenable Blog
K
Kaspersky official blog
AWS News Blog
AWS News Blog
S
Security @ Cisco Blogs
The GitHub Blog
The GitHub Blog
T
Threatpost
月光博客
月光博客
H
Heimdal Security Blog
Security Latest
Security Latest
The Hacker News
The Hacker News
Y
Y Combinator Blog
A
Arctic Wolf
Apple Machine Learning Research
Apple Machine Learning Research
C
Cisco Blogs
美团技术团队
Microsoft Security Blog
Microsoft Security Blog
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
C
CERT Recently Published Vulnerability Notes
D
Docker
Google Online Security Blog
Google Online Security Blog
D
DataBreaches.Net
V
Visual Studio Blog
H
Help Net Security

博客园 - zhengyan_web

rn 适配 鸿蒙 极光推送集成记录 xcode 打包 报错 main.jsbundle does not exist. react-native-background-job 加载依赖报错处理 解决gradle与gradle plugin匹配关系以及gradle下载缓慢的问题 ‌华为手机记录密码后页面显示的用户名可以通过修改设置来隐藏 极狐gitlab 搭建 rn node 版本问题 mac 电脑查看已安装的谷歌插件 xcode 15打包报错 网络代理 js编码、解码方法(escape,encodeURI,encodeURIComponent区别及用法) grep命令 苹果审核Guideline 2.3.1 - Performance XCode报错Thread 1: EXC_BAD_ACCESS (code=2, address=0x....) mac m1 运行老项目 docker 安装homebrew报错error: Not a valid ref: refs/remotes/origin/master 的解决方法 React Native 新版 pod install 依赖时报错
mac jdk切换
zhengyan_web · 2024-01-09 · via 博客园 - zhengyan_web

1: 下载安装不同的jdk版本

点这里可直达->JDK官方下载链接

2: 使用 vim  ~/.bash_profile 配置该文件,示例如下

#jdk 版本
export JAVA_HOME_8=/Library/Java/JavaVirtualMachines/jdk1.8.0_341.jdk/Contents/Home
export JAVA_HOME_11=/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home

#默认jdk1.8
export JAVA_HOME=$JAVA_HOME_8

#alias 命令动态切换jdk版本
alias jdk8="export JAVA_HOME=$JAVA_HOME_8"
alias jdk11="export JAVA_HOME=$JAVA_HOME_11"

3: 保存.bash_profile文件后,执行如下命令,使其立即生效

source /etc/profile ~/.bash_profile

备注:source后边必须跟"/etc/profile" 这个路径,否则通过alias别名切换jdk版本可能会失败

4: 通过alias别名命令校验是否成功

5:关闭窗口后 在使用 jdk11 命令切换后无效

在 ~/.bash_profile 文件后面插入 以下代码

if [ -f /etc/profile ]; then
. /etc/profile
fi