一,在使用Jenkins在MAC机器上运行代码时,有台机器出现 No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
代码在本地跑是正常的,查看机器上的JAVA环境,java -version,显示正常. 然后看环境变量vim ~/.bash_profile发现里面没有配置CLASSPATH 环境变量配置如下
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH:.
export CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.
export MAVEN_HOME=/Users/lin/apache-maven-3.5.4
export PATH=$PATH:$MAVEN_HOME/bin
配置完成wq保持,然后输入命令source ~/.bash_profile 再去项目里运行mvn
|