GraalVM
下载地址
VM
bash
# Linux
https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/graalvm-ce-java17-linux-amd64-22.3.1.tar.gz
https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/graalvm-ce-java17-linux-aarch64-22.3.1.tar.gz
# MacOS
https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/graalvm-ce-java17-darwin-amd64-22.3.1.tar.gz
https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/graalvm-ce-java17-darwin-aarch64-22.3.1.tar.gz
# Windows
https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/graalvm-ce-java17-windows-amd64-22.3.1.zip
Native Image
bash
# Linux
https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/native-image-installable-svm-java17-linux-amd64-22.3.1.jar
https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/native-image-installable-svm-java17-linux-aarch64-22.3.1.jar
# MacOS
https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/native-image-installable-svm-java17-darwin-amd64-22.3.1.jar
https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/native-image-installable-svm-java17-darwin-aarch64-22.3.1.jar
# Windows
https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/native-image-installable-svm-java17-windows-amd64-22.3.1.jar
安装
MacOS
graalvm
bash
# 解压缩
tar -xzf bellsoft-liberica-vm-full-openjdk17.0.6+10-22.3.1+1-macos-aarch64.zip
tar -xzf graalvm-ce-java17-darwin-aarch64-22.3.1.tar.gz
#
sudo xattr -r -d com.apple.quarantine bellsoft-liberica-vm-full-openjdk17-22.3.1
#
sudo mv bellsoft-liberica-vm-full-openjdk17-22.3.1 /Library/Java/JavaVirtualMachines
graalvm
bash
# 解压缩
tar -xzf graalvm-ce-java17-darwin-amd64-22.3.1.tar.gz
tar -xzf graalvm-ce-java17-darwin-aarch64-22.3.1.tar.gz
#
sudo xattr -r -d com.apple.quarantine ./graalvm-ce-java17-22.3.1
#
sudo mv graalvm-ce-java17-22.3.1 /Library/Java/JavaVirtualMachines
#
gu install native-image
Linux
graalvm
bash
# 解压缩
tar -xzf graalvm-ce-java17-linux-amd64-22.3.1.tar.gz
tar -xzf graalvm-ce-java17-linux-aarch64-22.3.1.tar.gz
# 重命名
sudo mv graalvm-ce-java17-22.3.1 graalvm
#
sudo mv graalvm /data/app/tools
# native-image
# 离线安装
gu install -L /data/app/temp/native-image-installable-svm-java17-linux-amd64-22.3.1.jar
# 在线安装
gu install native-image
# 检查是否安装成功
gu list
环境变量
bash
# 新建环境变量脚本
touch /etc/profile.d/java.sh
# 打开编辑环境变量脚本
vi /etc/profile.d/java.sh
增加以下内容
bash
export GRAALVM_HOME=/data/app/tools/graalvm
export JAVA_HOME=/data/app/tools/graalvm
export PATH=$GRAALVM_HOME/bin:$PATH
bash
# 分配权限
chmod 755 /etc/profile.d/java.sh
# 执行生效
source /etc/profile