theboyaply
theboyaply
发布于 2021-07-31 / 1091 阅读
0
0

centos卸载yum的jdk并重新安装jdk

参考资料:

https://blog.csdn.net/stone_tomcate/article/details/109641723

https://blog.csdn.net/weixin_40651304/article/details/78833642

mvn compiler报错

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project ruoyi-common: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] 
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command

查看原有jdk

[root@localhost ~]# java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

[root@localhost ~]# echo $JAVA_HOME
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre

查看安装包

[root@localhost ~]# rpm -qa | grep java
java-1.8.0-openjdk-headless-1.8.0.191.b12-1.el7_6.x86_64
java-1.7.0-openjdk-1.7.0.201-2.6.16.1.el7_6.x86_64
tzdata-java-2018g-1.el7.noarch
java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64
javapackages-tools-3.4.1-11.el7.noarch
java-1.7.0-openjdk-headless-1.7.0.201-2.6.16.1.el7_6.x86_64
python-javapackages-3.4.1-11.el7.noarch

卸载安装包

[root@localhost ~]# rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.191.b12-1.el7_6.x86_64
[root@localhost ~]# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.201-2.6.16.1.el7_6.x86_64
[root@localhost ~]# rpm -e --nodeps tzdata-java-2018g-1.el7.noarch
[root@localhost ~]# rpm -e --nodeps java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64
[root@localhost ~]# rpm -e --nodeps javapackages-tools-3.4.1-11.el7.noarch
[root@localhost ~]# rpm -e --nodeps java-1.7.0-openjdk-headless-1.7.0.201-2.6.16.1.el7_6.x86_64

重新安装jdk

可参考:https://www.theboyaply.cn/archives/jdk-install

-- end --


评论