赞
踩
shell 脚本在本地执行打包命令 mvn clean install -Dmaven.test.skip=true 报错 找不到JDK的错误,java的环境变量需要重新配置一下
下载地址:https://www.oracle.com/java/technologies/downloads/#jdk18-mac
下载完成后点击安装,按照提示进行操作
Java -version
/usr/libexec/java_home -V
结果
Matching Java Virtual Machines (2):
1.8.371.11 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
1.8.0_371 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk-1.8.jdk/Contents/Home
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
shell用的zsh,配置文件在 .zshrc中
进入配置文件
vi .zshrc
配置内容
JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk-1.8.jdk/Contents/Home"
CLASS_PATH="$JAVA_HOME/lib"
PATH=".$PATH:$JAVA_HOME/bin"
export JAVA_HOME
export PATH
export CLASSPATH
使配置生效
source ~/.zshrc
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。