分类目录归档:未分类

No Compiler is Provided in this environment Perhaps you are running on JRE rather than a JDK

Jenkins流水线部署Java项目提示:No Compiler is Provided in this environment Perhaps you are running on JRE rather than a JDK

可能的原因是调用了/usr/bin/java,但是这个指向的是jre。

# ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Jul 4 2020 /usr/bin/java -> /etc/alternatives/java

如果是这样,要找到JDK的地址并更改软连接

#whereis java
java: /usr/bin/java /usr/lib/java /etc/java /usr/share/java /data/soft/jdk1.8.0_151/bin/java /data/soft/jdk1.8.0_151/jre/bin/java /usr/share/man/man1/java.1.gz

rm /usr/bin/java
ln -s /data/soft/jdk1.8.0_151/bin/java /usr/bin/java