介绍Macos学习笔记的基本资料和访问方式
Macos学习笔记
- 1: 硬件
- 1.1: 查看硬件信息
- 1.1.1: MacCPUID
- 1.1.2: Intel Power Gadget
- 1.2: 硬件监控
- 1.2.1: System Toolkit
- 1.2.2: [归档]TG Pro
- 1.2.3: [归档]iStatistica Pro
- 1.3: 硬件测试
- 1.3.1: CPU Stress Test
- 1.4: 硬件设置
- 2: 系统
- 2.1: 系统工具
- 2.1.1: 安装配置oh-my-zsh
- 2.1.2: Brew
- 2.1.3: Alfred
- 2.1.4: 安装配置iTerm2
- 2.2: 虚拟机软件
- 2.2.1: VMware Fusion
- 3: 多媒体软件
- 3.1: 音乐播放软件
- 3.1.1: QQ音乐
- 3.1.2: Audirvana
- 3.1.3: hqplayer播放器
- 3.1.4: [归档]vox
- 3.2: 视频播放软件
- 3.2.1: Elmedia Player
- 4: 网络软件
- 4.1: 下载工具
- 4.1.1: Downie
- 4.2: 网络代理
- 4.3: 远程桌面
- 4.3.1: 自带远程管理
- 4.3.2: Jump Desktop
- 4.3.3: todesk
- 4.4: nfs工具
- 4.4.1: showmount 命令
- 4.4.2: 挂载 nfs 磁盘
- 4.5: 社交和通讯软件
- 4.6: 网络命令
- 4.6.1: lsof命令
- 5: 文档阅读软件
- 5.1: PDF阅读器
- 5.1.1: PDF优化
- 5.1.2: Edge
- 5.1.3: PDF Reader Pro
- 5.1.4: Apple Book
- 5.2: 电子书阅读器
- 5.2.1: Apple Book
- 5.3: 翻译软件
- 5.3.1: Deepl
- 6: 编辑器软件
- 6.1: Markdown编辑器
- 6.1.1: typora
- 6.2: Mindmap 编辑器
- 6.2.1: xmind
- 7: 图像和视频编辑
- 7.1: photoshop
- 7.2: Final Cut Pro
- 7.3: 佳能DPP
- 8: 编程开发
- 8.1: 通用工具
- 8.1.1: Sourcetree
- 8.1.2: sdkman
- 8.2: Java
- 8.2.1: JDK
- 8.2.2: Maven
- 8.2.3: Intellij IDEA
- 8.2.4: VisualVM
- 8.2.5: JDK Mission Control
- 8.2.6: Apache JMeter
- 8.3: Golang
- 8.3.1: Goland
- 8.4: Rust
- 8.4.1: CLion
1 - 硬件
1.1 - 查看硬件信息
1.1.1 - MacCPUID
MacCPUID 类似 windows 下的 cpu-z,但简陋的多。
下载
下载地址:Download MacCPUID (intel.com)
最新版本 3.1 。
运行
1.1.2 - Intel Power Gadget
Intel Power Gadget 是因特尔官方出品的一款基于软件对 CPU 电源使用情况进行监控的小工具,它可以实时监控基于 Intel各平台(包括台式机或笔记本) CPU 的功耗、负载、频率、温度等情况,结果非常准确。
我主要是用来查看黑苹果下的睿频、功耗,还有配合其他工具做cpu温度监控。
下载
下载地址:Intel® Power Gadget
最新版本 3.7.0 for macos 。
运行
参考资料
1.2 - 硬件监控
1.2.1 - System Toolkit
介绍
System Toolkit是Mac平台上的一款系统工具。System Toolkit提供了系统维护、隐私保护、磁盘清理、电池维护、网络状态监控、网络流量监控等实用的功能。
通过 System Toolkit 可以随时监控到进程负载,CPU温度,主内存消耗,存储空间,磁盘活动,网络接口上的通信等。
下载
- 破解版本:[System Toolkit 5.3.6 系统工具包 - 精品MAC应用分享 (xclient.info)](https://xclient.info/s/system-toolkit.html)
安装
安装 monitoring helper
在打开的界面上,选择 “download monitoring helper”,打开
https://sascha-simon.com/en/helper.html
下载 Helper.dmg 进行安装。重启 System Toolkit,在界面上选择 “auto start monitoring helper”
运行
概览页面:
平时在标题栏上的显示:
我一般打开自动启动:
1.2.2 - [归档]TG Pro
介绍
专业Mac硬件温度监控软件 TG Pro
TG Pro (Temperature Gauge Pro) 是一款专业显示你的Mac实时温度的软件,可以在系统内的菜单栏,独立菜单栏等位置显示出各个硬件的温度,也可以自定义风扇转速(可以根据mac温度设置风扇转速)
后记
貌似用处不大,平时 bios 的温控基本能解决问题。
先不用,以后有需要再说。
1.2.3 - [归档]iStatistica Pro
和 system toolkit 对比之后,放弃了iStatistica 而选择了 system toolkit
iStatistica Pro 2.1 是一款高颜值的系统监控工具
https://xclient.info/s/istatistica-pro.html#versions
安装后需要继续下载补丁文件 iStatisticaSensors。
1.3 - 硬件测试
1.3.1 - CPU Stress Test
简单的cpu压测测试工具
下载
下载地址:
Endurance: CPU Stress Test on the App Store (apple.com)
通过 app store 安装会更方便。
运行
intel 平台(黑苹果)的示意图:
m1 max 的示意图:
1.4 - 硬件设置
1.4.1 - RDM
下载
下载 RDM-2.2.dmg 进行安装。
问题
在 MacBook 16 m1 max 下,有个外接的 4k 便携式显示器无法开启 HiDPi,其他几台 4k 显示器都可以,连接方式包括:hdmi线,雷电3线,雷电3转hdmi转换头。
暂时还没有找到解决问题的方法。
感觉是没有识别到 HiDPi 信息:
在使用一键HiDPi脚本或使用Hackintool注入HiDPi后,我们就能使用这款软件方便快速地调整和设置自己想要的分辨率了。
TBD: 后面再试。
参考文档
1.4.2 - NTFS支持
简单方式:开启原生支持
考虑到日常对ntfs分区的写入非常少,另外盘符也通常比较固定,因此,简单开启 macos的ntfs写入功能就可以了。
具体方式为修改 /etc/fstab 文件(如果文件不存在则新建该文件),加入以下内容:
LABEL=**NAME** none ntfs rw,auto,nobrowsez
name 可以通过 diskutil list
来查看,以下是示例:
LABEL=download none ntfs rw,auto,nobrowse
LABEL=movie none ntfs rw,auto,nobrowse
LABEL=win10 none ntfs rw,auto,nobrowse
重启即可。Catalina/big sur下非常方便,自动mount完成而且方便访问。
警告
最新版本的Big Sur(11.4+)之后这个功能不再有效复杂方式:使用第三方软件
对比之后选择采用 Tuxera Disk Manager 来支持 ntfs 格式。
其他
反思:对于移动硬盘/做数据备份和存储的盘符,用 exfat 格式应该是麻烦最少的,各个操作系统都可以支持。
2 - 系统
2.1 - 系统工具
2.1.1 - 安装配置oh-my-zsh
macos 下的 oh-my-zsh 和 ubuntu 下使用方式一致,参见:
2.1.2 - Brew
介绍
安装
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
……
**Warning**: /opt/homebrew/bin is not in your PATH.
Instructions on how to configure your shell for Homebrew
can be found in the 'Next steps' section below.
**==>** **Installation successful!**
……
**==>** **Homebrew is run entirely by unpaid volunteers. Please consider donating:**
https://github.com/Homebrew/brew#donations
**==>** **Next steps:**
\- Run these two commands in your terminal to add Homebrew to your **PATH**:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/sky/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
\- Run **brew help** to get started
……
偶然会因为网络问题可以先设置代理再执行上面这段安装代码。代理设置方式如底下描述,对安装脚本也是适用的。
查看安装之后的版本:
% brew --version
Homebrew 3.1.5
Homebrew/homebrew-core (git revision 5e014bf244; last commit 2021-05-02)
代理设置
可以通过 export ALL_PROXY=proxyIP:port
方式设置代理(指向http代理):
$ export ALL_PROXY=127.0.0.1:1087
$ brew install socat
Updating Homebrew...
==> Installing dependencies for socat: openssl@1.1 and readline
==> Installing socat dependency: openssl@1.1
==> Downloading https://homebrew.bintray.com/bottles/openssl@1.1-1.1.1d.catalina
==> Downloading from https://akamai.bintray.com/d7/d7f992ebfd78f80828051f6dc6a1a
######################################################################## 100.0%
==> Pouring openssl@1.1-1.1.1d.catalina.bottle.tar.gz
也可以使用 socks5 代理,地址需要指定为 socks5 格式:
$ export ALL_PROXY=socks5://127.0.0.1:11080
$ brew install wget
Updating Homebrew...
==> Installing dependencies for wget: gettext, libunistring and libidn2
==> Installing wget dependency: gettext
==> Downloading https://homebrew.bintray.com/bottles/gettext-0.20.1.catalina.bot
==> Downloading from https://akamai.bintray.com/10/107d7f386fbeea6979f9376cdbbcf
######################################################################## 100.0%
==> Pouring gettext-0.20.1.catalina.bottle.tar.gz
代理快捷设置
修改 ~/.zshrc
文件,加入以下内容:
alias proxyon='export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890'
alias proxyoff='unset https_proxy http_proxy all_proxy'
这样就可以方便的在需要时设置brew的代理了。
2.1.3 - Alfred
2.2 - 虚拟机软件
2.2.1 - VMware Fusion
下载地址
官方下载地址:
破解版下载版本:
3.1.1 - QQ音乐
介绍
因为家有小爱同学,因此开通了QQ音乐的SVIP会员。
下载
QQ音乐-千万正版音乐海量无损曲库新歌热歌天天畅听的高品质音乐平台!
使用
慢慢体验吧,后续更新。
本地音乐
有个很简单的本地音乐播放功能,界面也很简陋,不太好用。
3.1.2 - Audirvana
介绍
Audirvana Plus 是一款Mac平台的高品质无损音乐播放器,是一个基于原生支援无损音讯压缩编码FLAC(Free Lossless Audio Codec)的音乐播放器,有别于MP3的有损压缩编码,它不会破坏任何原有的音讯资讯,可以完整地还原音乐CD的音质,提升Mac音质的音乐播放器,它还是目前为止唯一可以在Mac上播放SACD的软件。
Audirvana Plus 能让itunes音质逼近Logic Pro的音乐播放器,同时也是iTunes小插件,它可以让优秀的管理和操作与音质并存。
支持DSD、DST、SACD、FLAC、WAV、AIFF、AAC、MP3、SACD等常见音乐格式
下载地址
用着还行,继续体验。
设置
这是启动时的提示:
要允许 Audirvana 使用键盘中的「播放」和「下一首」键,请按照以下步骤操作:
-
打开 “系统偏好设置”
-
点击「安全性和隐私」 > 「隐私」
-
在列表中找到并选择 “自动化”
-
在「自动化」右侧列表中中找到 “Audirvana”
-
勾选复选框后即可生效(可能需要输入开机密码)
-
重启 Audirvana
音乐库
在界面上找到 “库”, “方式1:受监控的文件夹”,在这里增加音乐文件所在的目录。
音乐库专辑界面:
音乐库艺术家界面:
3.1.3 - hqplayer播放器
有破解版本可以安装,m1 上也能用。
但是使用不太方便,没有音乐库,播放歌曲要自己拖进去。
好在可以播放sacd,留着再试试。
3.1.4 - [归档]vox
下载
https://vox.rocks/mac-music-player/download
使用
没有本地库管理,不方便。
注册账号
有些功能需要有 vox 账号才可以使用,因此注册一个账号试试。
收费订阅就不用了,太贵。
参考资料
介绍:
3.2 - 视频播放软件
3.2.1 - Elmedia Player
介绍
参考:2022 年最佳 Mac 视频播放器 (eltima.com)
在所有视频播放器中,Elmedia Player 是最佳的 Mac 播放器
- 几乎可以打开所有媒体文件
- 设置非常广泛和详尽
- 完美的流媒体功能
- 兼容 AirPlay, Chromecast 和 DLNA
下载
下载地址:
https://www.elmedia-video-player.com/
安装
直接安装,m1上也可以用。
反馈
有段时间了,新版本下待验证
问题:
- 播放mkv格式会花屏
- 不能播放 iso 格式的单个文件,要先mount,然后播放文件夹
播放画质和音质还可以,另外可以作为音乐播放器使用,支持无损,但是不支持 dsd。
免广告观看 YouTube 视频
反馈:打开在线视频功能在播放youtube视频时不可用
4 - 网络软件
4.1 - 下载工具
4.1.1 - Downie
介绍
Downie 是 Mac OS X 上的一个超级易于使用的视频下载工具,支持YouTube,Vimeo 等大部分主流视频网站。它不会因为大量的选项而让用户困扰 - 它使用起来非常简单。支持国内的优酷和土豆以及国外的Youtube,如果你对视频下载有强烈的需求,那么Downie 是一个简单易用的视频下载工具。
下载
https://xclient.info/s/downie.html
安装
直接安装,m1可用
使用
youtube
在 youtube 视频上右键,“复制视频地址”,然后在 downie 界面上右键选择 “从粘贴板添加” ,即可下载。
有字幕时会提示选择不同语言的字幕。
4.2 - 网络代理
4.2.1 - Clashx
下载安装
从 github下载地址 下载到最新版本,正常安装。
配置
clashx的配置文件在 ~/.config/clash
目录下,修改 config.yaml 文件即可。
复制配置内容到 config.yaml 文件之后,启动 clashx 。
其他
Clashx 提供的"复制终端代理命令":
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
4.2.2 - V2rayX
下载
https://github.com/Cenmrev/V2RayX/releases
从 github 下载到最新版本,正常安装。
安装
下载 app,直接扔到应用中。
配置
TBD
4.3 - 远程桌面
4.3.1 - 自带远程管理
macos 自带远程管理功能。
参考官方文档:
-
菜单 –> “系统偏好设置” –> “共享”,选择“远程管理”复选框。
-
选择“仅这些用户”,点按添加按钮 ,然后选择可以共享 Mac 的用户。
4.3.2 - Jump Desktop
介绍
Jump Desktop 是MAC OS平台上的一款远程控制程序,支持Windows和Mac 双平台。
Jump Desktop 是一款Mac上非常强大和易用的远程桌面控制软件,支持RDP、VNC协议,无论速度、性能和流畅度上都非常不错,支持全屏、文本粘贴复制、快捷键发送等功能,可以用它远程连接Windows电脑,推荐使用!
下载
https://xclient.info/s/jump-desktop.html
安装
简单安装
使用
连接windows
点 “+” 添加计算机,类型选择 RDP
添加后再修改属性:
- auto logon
- display
- quality
4.3.3 - todesk
介绍
ToDesk for Mac 是一款免费而流畅的远程协助软件。ToDesk 支持1080P 高清屏幕控制以及文件传输。
下载
ToDesk macOS客户端下载:
https://www.todesk.com/download.html
安装
简单安装,m1 下可用。
使用
非常类似 teamview。
支持 4k 是意外之喜。
连接windows
在 windows 上同样安装 todesk。
连接linux
测试了一下 linux mint 20.04,可用,而且也支持 4k 屏幕。
发现多个屏幕时有bug,鼠标只能在其中一个屏幕上生效,只好改多屏幕为镜像模式。
遇到一个bug:桌面的状态栏我放在副屏幕上,没有修改就直接改成镜像模式了,导致没有状态栏可用,而且无法在图形界面上调出来。导致卡住了。后来发现解决的方法,在桌面调出终端,输入 cinnamon-settings
可以打开设置界面,然后 display 中恢复为多屏幕即可。
4.4 - nfs工具
4.4.1 - showmount 命令
$ showmount -e 192.168.0.1
Exports list on 192.168.0.1:
/mnt/download 192.168.0.0/16
/mnt/shared 192.168.0.0/16
4.4.2 - 挂载 nfs 磁盘
先通过 showmount 查看目标服务器上可以挂载的 nfs 资源列表:
$ showmount -e 192.168.0.1
Exports list on 192.168.0.1:
/mnt/download 192.168.0.0/16
/mnt/shared 192.168.0.0/16
手工 mount 这两个到本地:
mount -t nfs 192.168.0.1:/mnt/download /Users/sky/nfs/skyaio-download
mount -t nfs 192.168.0.1:/mnt/shared /Users/sky/nfs/skyaio-shared
参考资料:
4.5 - 社交和通讯软件
4.5.3 - teams
下载
https://apps.apple.com/cn/app/microsoft-teams/id1113153706
从 App Store 下载。
安装
略
配置
略
4.6 - 网络命令
4.6.1 - lsof命令
查看当前那些程序在监听端口:
sudo lsof -nP -iTCP -sTCP:LISTEN
5 - 文档阅读软件
5.1 - PDF阅读器
5.1.1 - PDF优化
由于pdf阅读器往往都存在某些功能确实,因此为了最大限度的提升pdf 的阅读体验,可以对 pdf 文件本身先做一些优化。
切边
切边减少左右两侧的白边,也有助于扩大显示访问和加大显示字体的大小。
KoReader的切边功能是典型代表。但很多 pdf 浏览器不提供切边的功能,因此只能自己动手。
pdfcrop 在线切边
选择 pdf 文件上传,然后选择 “autocrop” 自动切边,再下载完成后的 pdf 文件。
5.1.2 - Edge
介绍
Microsoft Edge 浏览器支持直接阅读 PDF 文档。
使用
直接将 pdf 文件拖进去 edge 浏览器界面,就可以打开。
改善阅读体验的方法:
- edge全屏显示
- 隐藏收藏夹:在 edge 浏览器的收藏夹上右键,“显示收藏夹栏” 中选择 “仅在新标签页上”。这样对于打开的页面(包括pdf)就不会显示收藏夹。
- 最有效的技巧:把屏幕竖起来(特指外界的屏幕,一般为4k 16:9,27寸)
- 左右键翻页:前提是缩放时注意不要出现横向的滚动条
可惜,少了一些功能:
- 类似 pdf reader pro 的页面背景设置
- 类似 KOReader 的切边
- 没有阅读模式,无法隐藏上面的三排工具栏
其他功能
点击 “阅读此页内容” 可以机器阅读pdf内容。
5.1.3 - PDF Reader Pro
介绍
PDF Reader Pro是一款Mac平台的PDF文档阅读编辑器,除了可以进行 PDF 文档阅读以外,你还可以对文档进行备注、编辑、标注等,还可以添加笔记和书签,如果想要演示的话,还可以配合遥控来进行演示。
下载
https://xclient.info/s/pdf-reader-pro.html#versions
安装
正常安装,m1 可用。
使用
打开 pdf 文件,默认时编辑默认,顶部有工具栏会妨碍阅读。
可进入阅读模式:
- 查看 -》 阅读模式
- 翻页的键盘快捷键:fn + 上/下键。(界面有上一页/下一页的按钮,但需要用鼠标点,不方便)
- 背景可以修改,更护眼。
TBD:
- 没有找到类似 koreader 切边的功能,只能用触摸板放大到适当比例,然后翻页阅读
5.1.4 - Apple Book
介绍
Mac 自带的 Apple Book 应用很适合用来看电子书,包括 pdf。
使用
直接将 pdf 文件拖进去 Apple Book 界面,就可以导入到库中,然后双击打开。
改善阅读体验的方法:
- 全屏显示
- 左右键翻页:前提是缩放时注意不要出现横向的滚动条
可惜,少了一些功能:
- 类似 pdf reader pro 的页面背景设置
- 类似 KOReader 的切边
其他功能
幻灯片放映功能不错,可惜不能只显示单页,必须显示两页,字就太小了。
5.2 - 电子书阅读器
5.2.1 - Apple Book
介绍
Mac 自带的 Apple Book 应用很适合用来看电子书,出了 pdf 格式之外,还支持 epub 等格式。
使用
直接将 epub 文件拖进去 Apple Book 界面,就可以导入到库中,然后双击打开。
改善阅读体验的方法:
- 全屏显示
- command 加
+
或者-
可以缩放字体大小(epub格式就是有这个好处) - 左右键翻页:前提是缩放时注意不要出现横向的滚动条
- 背景色修改:点工具栏(自动隐藏,因此将鼠标移动到接近顶部的地方)中的 “大小”,就可以选择背景色
- 字体修改:同上,在"大小"里面可以设置字体,对比中发现 “San Francisco” 字体对眼睛最友好。
体验非常好。
5.3 - 翻译软件
5.3.1 - Deepl
下载
https://www.deepl.com/zh/app/thanks?os=macOS
安装
正常安装,m1可用。
配置
在 deepl 的配置中
- 设置 “启动系统时启用deepl”:开机自动启动
- deepl 快捷键保持默认的 ⌘+C+C 不变
- 添加 deepl 到访达 扩展菜单
使用
四种翻译方式:
- 选择要翻译的内容,按⌘+C+C进行翻译
- 复制要翻译的内容到 deepl 中
- 将要翻译的文档拖到 deepl 中翻译整个文档 (需要 deepl pro)
- 在 crowdin 中配置 deepl (有免费版,但也必须要有信用卡)
订阅
最麻烦的是订阅,想交钱都不行,必须要有国外地址的信用卡。
6 - 编辑器软件
6.1 - Markdown编辑器
6.1.1 - typora
介绍
最喜欢的 markdown 编辑器。
下载
官网下载,会要求购买,试用期期间总是发提醒:
破解版本下载地址:
https://xclient.info/s/typora.html
安装
简单安装,m1 可用。
使用
TBD
6.2 - Mindmap 编辑器
7 - 图像和视频编辑
7.1 - photoshop
下载地址
忘了从哪里下载的了。
安装
直接安装会报错:
- The installation cannot continue as the installer file may be damaged.
需要将“安装”目录所有的文件内容复制到硬盘,然后执行命令:
sudo xattr -d com.apple.quarantine /Users/sky/data/安装/Install.app
之后再断开网络进行安装。
破解
下载安装配套的 Adobe Zii 2 软件。
- 打开『访达』,点击『应用程序』
- 打开『Adobe Photoshop 2020』文件夹,找到『Adobe Photoshop 2020.app』:注意不是直接拖动 photoshop 的图标,而是双击进去目录。
- 打开 「Adobe Zii 2021 6.0.6」,将『Adobe Photoshop 2020.app』拖动到「Adobe Zii」的 「PATCH OR DRAG」 界面上,出现 COMPLETED 即可激活成功。
7.3 - 佳能DPP
Digital Photo Professional 是佳能官方出品的图片处理软件,提供Macos版本。
下载地址
https://www.canon.com.cn/supports/download/simsdetail/0200618705.html?modelId=1828&channel=2
最新版本可以从下面链接找到:
8 - 编程开发
8.1 - 通用工具
8.1.1 - Sourcetree
下载
https://www.sourcetreeapp.com/
安装
解压,将得到的app文件拖到macos的应用中即可。
使用
M1 下可用。
8.1.2 - sdkman
介绍
SDKMAN 是一款管理多版本 SDK 的工具,可以实现在多个版本间的快速切换。
安装
安装方法参考官方文档:
$ curl -s "https://get.sdkman.io" | bash
安装完成后,关闭当前终端重新打开新的终端,或者在当前终端中执行下面的命令立即更新:
source "/Users/sky/.sdkman/bin/sdkman-init.sh"
验证一下安装的版本:
$ sdk version
SDKMAN 5.14.1
默认情况下,sdkman 安装在 HOME 下的 .sdkman
子目录中:
$ ls ~/.sdkman
archives bin candidates contrib etc ext src tmp var
m1 下开启 rosetta2 兼容模式
在 m1 下,默认 rosetta2 兼容模式是关闭的,因此在 m1 上只能列出来 arm64 版本的 SDK。
以 java SDK 为例:
$ sdk list java
================================================================================
Available Java Versions for macOS ARM 64bit
================================================================================
Vendor | Use | Version | Dist | Status | Identifier
--------------------------------------------------------------------------------
Corretto | | 17.0.2.8.1 | amzn | | 17.0.2.8.1-amzn
Java.net | | 19.ea.13 | open | | 19.ea.13-open
| | 19.ea.12 | open | | 19.ea.12-open
| | 19.ea.11 | open | | 19.ea.11-open
| | 19.ea.10 | open | | 19.ea.10-open
| | 19.ea.4.lm | open | | 19.ea.4.lm-open
| | 18 | open | | 18-open
| | 18.ea.35 | open | | 18.ea.35-open
| | 17.0.2 | open | | 17.0.2-open
| >>> | 11.0.2 | open | local only | 11.0.2-open
Liberica | | 17.0.2.fx | librca | | 17.0.2.fx-librca
| | 17.0.2 | librca | | 17.0.2-librca
| | 11.0.14 | librca | | 11.0.14-librca
| | 8.0.322 | librca | | 8.0.322-librca
Microsoft | | 17.0.2 | ms | | 17.0.2-ms
| | 11.0.14 | ms | | 11.0.14-ms
Oracle | | 17.0.2 | oracle | | 17.0.2-oracle
SapMachine | | 17.0.2 | sapmchn | | 17.0.2-sapmchn
Temurin | | 17.0.2 | tem | | 17.0.2-tem
Zulu | | 17.0.2 | zulu | | 17.0.2-zulu
| | 17.0.2.fx | zulu | | 17.0.2.fx-zulu
| | 11.0.14 | zulu | | 11.0.14-zulu
| | 8.0.322 | zulu | | 8.0.322-zulu
以上是支持 macos + arm64 的 JDK。
如果要开启 rosetta2 兼容模式,需要修改 sdkman 的配置,vi ~/.sdkman/etc/config
:
sdkman_auto_answer=false
sdkman_auto_complete=true
sdkman_auto_env=false
sdkman_auto_update=true
sdkman_beta_channel=false
sdkman_checksum_enable=true
sdkman_colour_enable=true
sdkman_curl_connect_timeout=7
sdkman_curl_max_time=10
sdkman_debug_mode=false
sdkman_insecure_ssl=false
sdkman_rosetta2_compatible=false # 修改这里为 true
sdkman_selfupdate_feature=true
将 sdkman_rosetta2_compatible 修改为 true。修改后在当前终端中执行下面的命令立即更新:
source "/Users/sky/.sdkman/bin/sdkman-init.sh"
此时再执行 list java 就能看到更多的安装选项了:
$ sdk list java
================================================================================
Available Java Versions for macOS 64bit
================================================================================
Vendor | Use | Version | Dist | Status | Identifier
--------------------------------------------------------------------------------
Corretto | | 17.0.2.8.1 | amzn | | 17.0.2.8.1-amzn
| | 11.0.14.10.1 | amzn | | 11.0.14.10.1-amzn
| | 11.0.14.9.1 | amzn | | 11.0.14.9.1-amzn
| | 8.322.06.2 | amzn | | 8.322.06.2-amzn
| | 8.322.06.1 | amzn | | 8.322.06.1-amzn
Gluon | | 22.0.0.3.r17 | gln | | 22.0.0.3.r17-gln
| | 22.0.0.3.r11 | gln | | 22.0.0.3.r11-gln
GraalVM | | 22.0.0.2.r17 | grl | | 22.0.0.2.r17-grl
| | 22.0.0.2.r11 | grl | | 22.0.0.2.r11-grl
| | 21.3.1.r17 | grl | | 21.3.1.r17-grl
| | 21.3.1.r11 | grl | | 21.3.1.r11-grl
| | 21.2.0.r16 | grl | | 21.2.0.r16-grl
| | 21.2.0.r11 | grl | | 21.2.0.r11-grl
| | 20.3.5.r11 | grl | | 20.3.5.r11-grl
| | 19.3.6.r11 | grl | | 19.3.6.r11-grl
Java.net | | 19.ea.13 | open | | 19.ea.13-open
| | 19.ea.12 | open | | 19.ea.12-open
| | 19.ea.11 | open | | 19.ea.11-open
| | 19.ea.10 | open | | 19.ea.10-open
| | 19.ea.4.lm | open | | 19.ea.4.lm-open
| | 19.ea.1.pma | open | | 19.ea.1.pma-open
| | 18 | open | | 18-open
| | 18.ea.35 | open | | 18.ea.35-open
| | 17.0.2 | open | | 17.0.2-open
| >>> | 11.0.2 | open | | 11.0.2-open
Liberica | | 17.0.2.fx | librca | | 17.0.2.fx-librca
| | 17.0.2 | librca | | 17.0.2-librca
| | 11.0.14.fx | librca | | 11.0.14.fx-librca
| | 11.0.14 | librca | | 11.0.14-librca
| | 8.0.322.fx | librca | | 8.0.322.fx-librca
| | 8.0.322 | librca | | 8.0.322-librca
Liberica NIK | | 22.0.0.2.r17 | nik | | 22.0.0.2.r17-nik
| | 22.0.0.2.r11 | nik | | 22.0.0.2.r11-nik
| | 21.3.1.r17 | nik | | 21.3.1.r17-nik
| | 21.3.1.r11 | nik | | 21.3.1.r11-nik
| | 21.3.0.r17 | nik | | 21.3.0.r17-nik
| | 21.3.0.r11 | nik | | 21.3.0.r11-nik
| | 21.2 | nik | | 21.2-nik
Microsoft | | 17.0.2 | ms | | 17.0.2-ms
| | 11.0.14 | ms | | 11.0.14-ms
Oracle | | 17.0.2 | oracle | | 17.0.2-oracle
SapMachine | | 17.0.2 | sapmchn | | 17.0.2-sapmchn
| | 11.0.14 | sapmchn | | 11.0.14-sapmchn
| | 11.0.14.1 | sapmchn | | 11.0.14.1-sapmchn
Semeru | | 17.0.2 | sem | | 17.0.2-sem
| | 11.0.14 | sem | | 11.0.14-sem
| | 11.0.14.1 | sem | | 11.0.14.1-sem
| | 8.0.322 | sem | | 8.0.322-sem
Temurin | | 17.0.2 | tem | | 17.0.2-tem
| | 11.0.14 | tem | | 11.0.14-tem
| | 8.0.322 | tem | | 8.0.322-tem
Trava | | 11.0.9 | trava | | 11.0.9-trava
| | 8.0.232 | trava | | 8.0.232-trava
Zulu | | 17.0.2 | zulu | | 17.0.2-zulu
| | 17.0.2.fx | zulu | | 17.0.2.fx-zulu
| | 11.0.14 | zulu | | 11.0.14-zulu
| | 11.0.14.fx | zulu | | 11.0.14.fx-zulu
| | 8.0.322 | zulu | | 8.0.322-zulu
| | 8.0.322.fx | zulu | | 8.0.322.fx-zulu
| | 7.0.332 | zulu | | 7.0.332-zulu
使用
备注:M1 下可用。
使用方法参考官方文档:
具体的使用可以看后面章节。
参考文档
8.2 - Java
8.2.1 - JDK
在 m1 macbook 上安装 jdk 相对会有更多的麻烦,因为 m1 的 cpu 架构不再时传统的 x86_64 ,而是 aarch64 (arm64)。
安装 JAVA SDK (for M1)
暂时使用 jdk 11,在 m1 上需要安装多个版本:
- zuul jdk : arm64 版本,作为原生版本使用
- openjdk 11: x64 版本
- graalvm 11: x64 版本,学习 quarks / spring native 使用。(备注:graalvm 目前还没有 m1 原生支持)
zulu 11.0.14 (arm64)
zulu 是对 macos + arm64 支持比较好的 jdk,推荐作为 m1 的原生 java sdk:
$ sdk install java 11.0.14-zulu
Downloading: java 11.0.14-zulu
In progress...
##################################################################################################################################################### 100.0%
Repackaging Java 11.0.14-zulu...
Done repackaging...
Installing: java 11.0.14-zulu
Done installing!
Do you want java 11.0.14-zulu to be set as default? (Y/n): y
Setting java 11.0.14-zulu as default.
但特别注意,如果开启了 rosetta2 兼容模式,则会安装 x86_64 版本,而不是我们期望的 arm64 版本。
删除已经安装的 x86_64 版本的zulu jdk,特别注意要删除已经下载的 sdk 缓存文件,不然下次安装时会报告本地已经有文件而跳过下载过程。由于本地的是之前下载的 x86_64 版本,因此会导致无法安装 arm64 版本,必须删除本地缓存目录 ~/.sdkman/archives
下对应的安装文件:
# 删除已经安装的 x86_64 版本的zulu jdk
$ sdk uninstall java 11.0.14-zulu
# 删除已经下载的 java-11.0.14-zulu.zip 文件
$ ls ~/.sdkman/archives
java-11.0.14-zulu.zip java-11.0.2-open.zip java-20.3.5.r11-grl.zip maven-3.8.5.zip
$ rm ~/.sdkman/archives/java-11.0.14-zulu.zip
备注:下载的安装文件不区分是否是 rosetta2 兼容模式,x86_64 和 arm64 下安装文件名是相同的。
如果要安装 arm64 版本,则需要关闭 rosetta2 兼容模式。vi ~/.sdkman/etc/config
:
sdkman_rosetta2_compatible=true # 修改这里为 false 关闭 rosetta2 兼容模式
修改后在当前终端中执行下面的命令立即更新:
source "/Users/sky/.sdkman/bin/sdkman-init.sh"
再次安装即可:
sdk install java 11.0.14-zulu
Downloading: java 11.0.14-zulu
In progress...
##################################################################################################################################################### 100.0%
Repackaging Java 11.0.14-zulu...
Done repackaging...
Installing: java 11.0.14-zulu
Done installing!
Setting java 11.0.14-zulu as default.
还是需要执行下面的命令立即更新:
source "/Users/sky/.sdkman/bin/sdkman-init.sh"
然后检查安装后的 java 设置:
$ which java
/Users/sky/.sdkman/candidates/java/current/bin/java
$ env | grep JAVA_HOME
JAVA_HOME=/Users/sky/.sdkman/candidates/java/current
$ java --version
openjdk 11.0.14 2022-01-18 LTS
OpenJDK Runtime Environment Zulu11.54+23-CA (build 11.0.14+9-LTS)
OpenJDK 64-Bit Server VM Zulu11.54+23-CA (build 11.0.14+9-LTS, mixed mode)
openjdk 11 (x86_64)
$ sdk install java 11.0.2-open
Downloading: java 11.0.2-open
In progress...
################################################################################################################################ 100.0%
Repackaging Java 11.0.2-open...
Done repackaging...
Cleaning up residual files...
Installing: java 11.0.2-open
Done installing!
Setting java 11.0.2-open as default.
安装完成之后,可以通过 sdk current
命令看到当前正在使用的 sdk 和版本:
$ sdk current
Using:
java: 11.0.2-open
检查一下当前的 java 设置:
$ which java
/Users/sky/.sdkman/candidates/java/current/bin/java
$ java --version
openjdk 11.0.2 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
$ env | grep JAVA_HOME
JAVA_HOME=/Users/sky/.sdkman/candidates/java/current
查看 一下本地文件的目录结构就清楚了:
$ ls -l /Users/sky/.sdkman/candidates/java/
total 0
drwxr-xr-x 9 sky staff 288 1 18 2019 11.0.2-open
lrwxr-xr-x 1 sky staff 11 3 20 08:04 current -> 11.0.2-open
graalvm 20.3.5.r11 (x86_64)
为了使用 quarkus,安装 graalvm 20 版本,由于 graalvm 暂时没有 m1 可用的 arm64 版本,因此只能安装 x86_64 版本:
sdk install java 20.3.5.r11-grl
检查安装后的 java 设置:
$ which java
/Users/sky/.sdkman/candidates/java/20.3.5.r11-grl/bin/java
$ java --version
openjdk 11.0.14 2022-01-18
OpenJDK Runtime Environment GraalVM CE 20.3.5 (build 11.0.14+9-jvmci-20.3-b28)
OpenJDK 64-Bit Server VM GraalVM CE 20.3.5 (build 11.0.14+9-jvmci-20.3-b28, mixed mode, sharing)
$ env | grep JAVA_HOME
JAVA_HOME=/Users/sky/.sdkman/candidates/java/20.3.5.r11-grl
maven
$ sdk install maven
Downloading: maven 3.8.5
In progress...
######################################################################### 100.0%
Installing: maven 3.8.5
Done installing!
Setting maven 3.8.5 as default.
检查 maven 的安装, mvn 没有 arch 的差异,完全取决于当前 maven 使用的 java sdk。因此使用不同 java sdk 时的输出是不一样的。
查看当前安装好的 java sdk :
$ sdk list java | grep installed
| | 20.3.5.r11 | grl | installed | 20.3.5.r11-grl
| | 11.0.2 | open | installed | 11.0.2-open
| >>> | 11.0.14 | zulu | installed | 11.0.14-zulu
对比 mvn --version
在不同 java sdk 下的 输出。 在 openjdk x86_64 下:
$ sdk use java 11.0.2-open
$ mvn --version
Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
Maven home: /Users/sky/.sdkman/candidates/maven/current
Java version: 11.0.2, vendor: Oracle Corporation, runtime: /Users/sky/.sdkman/candidates/java/11.0.2-open
Default locale: zh_CN_#Hans, platform encoding: UTF-8
OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"
$ env | grep MAVEN_HOME
MAVEN_HOME=/Users/sky/.sdkman/candidates/maven/current
在 graalvm x86_64 下:
$ sdk use java 20.3.5.r11-grl
$ mvn --version
Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
Maven home: /Users/sky/.sdkman/candidates/maven/current
Java version: 11.0.14, vendor: GraalVM Community, runtime: /Users/sky/.sdkman/candidates/java/20.3.5.r11-grl
Default locale: zh_CN_#Hans, platform encoding: UTF-8
OS name: "mac os x", version: "12.3", arch: "x86_64", family: "mac"
在 zulu arm64 下:
$ sdk use java 11.0.14-zulu
$ mvn --version
Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
Maven home: /Users/sky/.sdkman/candidates/maven/current
Java version: 11.0.14, vendor: Azul Systems, Inc., runtime: /Users/sky/.sdkman/candidates/java/11.0.14-zulu/zulu-11.jdk/Contents/Home
Default locale: zh_CN_#Hans, platform encoding: UTF-8
OS name: "mac os x", version: "12.3", arch: "aarch64", family: "mac"
注意: zulu arm64 下 maven 的输出中 arch 终于改为 “aarch64” ,而不是 “x86_64”。
这个方法也可以用来快速检查当前 java sdk 是 “x86_64” 还是 “aarch64” (arm64)版本。
自动切换JDK
通常使用场景时默认使用一个 jdk,然后在某些目录下需要使用其他的 jdk。例如我在 m1 macbook 下默认使用 aarch64 (arm64) 的 zulu jdk,但在某些特殊项目如 dapr 的 java-sdk 项目下,必须使用 x86_64 的 openjdk。
sdkman 提供在进入某些项目或目录时自动切换 sdk 的功能。
vi ~/.sdkman/etc/config
打开 sdkman 的配置文件,设置 sdkman_auto_env
为true:
sdkman_auto_env=true
source "~/.sdkman/bin/sdkman-init.sh"
让配置生效。然后:
# 用 mvn --version 命令查看 arch,默认用的是 zulu jdk,因此是 aarch64
mvn --version
OS name: "mac os x", version: "12.3", arch: "aarch64", family: "mac"
# 进入需要设置的目录
$ cd word/code/dapr/java-sdk
# 切换到 x86-64 的 openjdk
$ sdk use java 11.0.2-open
# 用 mvn --version 命令查看 arch,此时是 x86_64
$ mvn --version
OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"
# 初始化sdk env,sdkman 会记录下当前使用的 jdk 到当前目录下的 .sdkmanrc 文件
$ sdk env init
.sdkmanrc created.
vi .sdkmanrc
查看内容:
# Enable auto-env through the sdkman_auto_env config
# Add key=value pairs of SDKs to use below
java=11.0.2-open
在终端中尝试进入和退出项目所在目录:
$ cd ..
Restored java version to 11.0.14-zulu (default)
$ cd java-sdk
Using java version 11.0.2-open in this shell.
# 在子目录中跳转时不会触发自动切换的,也就是目录下的所有子目录都将维持这个sdk设置
$ cd sdk-autogen
参考文档
8.2.2 - Maven
安装
使用 sdkman 安装maven
$ sdk install maven
Downloading: maven 3.8.5
In progress...
######################################################################### 100.0%
Installing: maven 3.8.5
Done installing!
Setting maven 3.8.5 as default.
检查 maven 的安装, mvn 没有 arch 的差异,完全取决于当前 maven 使用的 java sdk。因此使用不同 java sdk 时的输出是不一样的。
$ sdk use java 11.0.14-zulu
$ mvn --version
Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0)
Maven home: /Users/sky/.sdkman/candidates/maven/current
Java version: 11.0.14, vendor: Azul Systems, Inc., runtime: /Users/sky/.sdkman/candidates/java/11.0.14-zulu/zulu-11.jdk/Contents/Home
Default locale: zh_CN_#Hans, platform encoding: UTF-8
OS name: "mac os x", version: "12.3", arch: "aarch64", family: "mac"
配置
TBD
8.2.3 - Intellij IDEA
下载
Download IntelliJ IDEA: The Capable & Ergonomic Java IDE by JetBrains
下载时注意根据 cpu 芯片进行选择,有 intel 和 Apple Silicon 两种。
M1 应选择 MacOS 下的 .dmg(Apple Silicon)
下载安装。
安装
简单安装。
配置
TBD
8.2.4 - VisualVM
安装
使用 sdkman 安装VisualVM
$ sdk install visualvm
Downloading: visualvm 2.1.2
In progress...
######################################################################### 100.0%######################################################################### 100.0%
Installing: visualvm 2.1.2
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/modules/org-graalvm-visualvm-lib-profiler.jar
No such file or directory
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/update_tracking/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/update_tracking/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/update_tracking/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/modules/locale/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/modules/locale/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/modules/locale/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/modules/ext/locale/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/modules/ext/locale/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/modules/ext/locale/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/modules/ext/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/modules/ext/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/modules/ext/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/windows/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/windows/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/windows/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/windows-amd64/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/windows-amd64/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/windows-amd64/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/solaris-sparcv9/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/solaris-sparcv9/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/solaris-sparcv9/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/solaris-sparc/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/solaris-sparc/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/solaris-sparc/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/solaris-i386/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/solaris-i386/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/solaris-i386/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/solaris-amd64/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/solaris-amd64/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/solaris-amd64/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/mac/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/mac/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/mac/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/linux/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/linux/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/linux/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/linux-arm/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/linux-arm/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/linux-arm/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/linux-arm-vfp-hflt/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/linux-arm-vfp-hflt/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/linux-arm-vfp-hflt/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/linux-amd64/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/linux-amd64/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/linux-amd64/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/linux-aarch64/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/linux-aarch64/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/linux-aarch64/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk16/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/windows/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/windows/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/windows/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/windows-amd64/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/windows-amd64/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/windows-amd64/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/solaris-sparcv9/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/solaris-sparcv9/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/solaris-sparcv9/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/solaris-sparc/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/solaris-sparc/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/solaris-sparc/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/solaris-i386/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/solaris-i386/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/solaris-i386/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/solaris-amd64/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/solaris-amd64/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/solaris-amd64/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/mac/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/mac/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/mac/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/linux/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/linux/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/linux/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/linux-amd64/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/linux-amd64/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/linux-amd64/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/jdk15/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/deployed/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/lib/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/core/locale/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/core/locale/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/core/locale/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/core/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/core/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/core/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/config/Modules/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/config/Modules/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/config/Modules/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/config/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/config/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/visualvm/config/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/update_tracking/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/update_tracking/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/update_tracking/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/lib/x86/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/lib/x86/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/lib/x86/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/lib/i386/linux/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/lib/i386/linux/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/lib/i386/linux/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/lib/i386/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/lib/i386/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/lib/i386/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/lib/amd64/linux/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/lib/amd64/linux/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/lib/amd64/linux/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/lib/amd64/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/lib/amd64/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/lib/amd64/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/lib/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/lib/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/lib/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/ext/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/ext/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/ext/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/modules/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/lib/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/lib/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/lib/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/core/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/core/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/core/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/config/Modules/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/config/Modules/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/config/Modules/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/config/ModuleAutoDeps/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/config/ModuleAutoDeps/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/config/ModuleAutoDeps/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/config/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/config/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/config/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/platform/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/etc/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/etc/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/etc/
warning: cannot set modif./access times for /Users/sky/.sdkman/tmp/out/visualvm_212/bin/
No such file or directory
warning: cannot set permissions for /Users/sky/.sdkman/tmp/out/visualvm_212/bin/
No such file or directory
warning: set times/attribs failed for /Users/sky/.sdkman/tmp/out/visualvm_212/bin/
mv: /Users/sky/.sdkman/candidates/visualvm/2.1.2 is not a directory
Done installing!
Setting visualvm 2.1.2 as default.
再安装一次,成功了:
$ sdk install visualvm
Found a previously downloaded visualvm 2.1.2 archive. Not downloading it again...
Installing: visualvm 2.1.2
Done installing!
Do you want visualvm 2.1.2 to be set as default? (Y/n): Y
Setting visualvm 2.1.2 as default.
jvisualvm --version
The operation couldn’t be completed. Unable to locate a Java Runtime that supports jvisualvm.
Please visit http://www.java.com for information on installing Java.
➜ ~ which jvisualvm
/usr/bin/jvisualvm
$ sudo rm /usr/bin/jvisualvm
Password:
Sorry, try again.
Password:
Sorry, try again.
Password:
override rwxr-xr-x root/wheel restricted,compressed for /usr/bin/jvisualvm? y
rm: /usr/bin/jvisualvm: Operation not permitted
配置
TBD
8.2.5 - JDK Mission Control
介绍
https://www.oracle.com/java/technologies/jdk-mission-control.html
在 zule jdk上,使用的是 zulu mission control:
https://www.azul.com/products/components/zulu-mission-control/
支持
安装
使用 sdkman 安装
默认的 jmc 8.1.1.51-zulu 版本不支持 m1:
$ sdk install jmc
Stop! jmc 8.1.1.51-zulu is not available. Possible causes:
* 8.1.1.51-zulu is an invalid version
* jmc binaries are incompatible with your platform
* jmc has not been released yet
Tip: see all available versions for your platform:
$ sdk list jmc
用 sdk list jmc
命令查看发现有 8.1.1.57-zulu 版本:
$ sdk list jmc
================================================================================
Available Jmc Versions
================================================================================
> 8.1.1.57-zulu
用这个 8.1.1.57-zulu 版本继续安装:
$ sdk install jmc 8.1.1.57-zulu
Downloading: jmc 8.1.1.57-zulu
In progress...
######################################################################### 100.0%
Repackaging JMC zulu 8.1.1.57-zulu...
Done repackaging...
Installing: jmc 8.1.1.57-zulu
mv: /Users/sky/.sdkman/candidates/jmc/8.1.1.57-zulu is not a directory
Done installing!
Setting jmc 8.1.1.57-zulu as default.
安装时似乎出错了,ls ~/.sdkman/candidates/jmc
检查 .sdkman 目录下发现安装的确出错了:
$ ls -l ~/.sdkman/candidates/jmc
lrwxr-xr-x 1 sky staff 13 3 21 08:18 current -> 8.1.1.57-zulu
再安装一次:
$ sdk install jmc 8.1.1.57-zulu
Found a previously downloaded jmc 8.1.1.57-zulu archive. Not downloading it again...
Installing: jmc 8.1.1.57-zulu
Done installing!
Do you want jmc 8.1.1.57-zulu to be set as default? (Y/n): Y
Setting jmc 8.1.1.57-zulu as default.
这次对了:
$ ls -l ~/.sdkman/candidates/jmc
drwxr-xr-x 6 sky staff 192 3 21 07:47 8.1.1.57-zulu
lrwxr-xr-x 1 sky staff 13 3 21 08:18 current -> 8.1.1.57-zulu
但执行时报错:
$ jmc version
The operation couldn’t be completed. Unable to locate a Java Runtime that supports jmc.
Please visit http://www.java.com for information on installing Java.
$ which jmc
/usr/bin/jmc
Jmc 指向的是 /usr/bin/jmc
,这个应该是我之前手工安装 zule jdk 时复制过去的文件。
sudo rm -rf /usr/bin/jmc
rm: /usr/bin/jmc: Operation not permitted
手工安装
https://www.azul.com/products/components/zulu-mission-control/#block-download
配置
TBD
8.2.6 - Apache JMeter
介绍
安装
使用 sdkman 安装
$ sdk install jmeter
Downloading: jmeter 5.4.3
In progress...
######################################################################### 100.0%
Installing: jmeter 5.4.3
Done installing!
Setting jmeter 5.4.3 as default.
配置
TBD
8.3 - Golang
8.3.1 - Goland
下载
https://www.jetbrains.com/go/download/#section=mac
下载时注意根据 cpu 芯片进行选择,有 intel 和 Apple Silicon 两种。
M1 应选择 MacOS 下的 .dmg(Apple Silicon)
下载安装。
安装
简单安装。
配置
TBD
8.4 - Rust
8.4.1 - CLion
下载
https://www.jetbrains.com/clion/download/#section=mac
下载时注意根据 cpu 芯片进行选择,有 intel 和 Apple Silicon 两种。
M1 应选择 MacOS 下的 .dmg(Apple Silicon)
下载安装。
安装
简单安装。
配置
TBD