idea中 使用maven出现 No compiler is provided in this environment. Perhaps you are running on a JRE rathe

idea中 使用maven出现 No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? (已解决)

问题源头

百度很久没解决,查了下谷歌,恍然大悟。
原来jdk还有openjdk这种版本 !?
idea中 使用maven出现 No compiler is provided in this environment. Perhaps you are running on a JRE rathe

猜测是lib里面没有jre目录,也没有tools.jar,maven引用时就会报错
idea中 使用maven出现 No compiler is provided in this environment. Perhaps you are running on a JRE rathe

解决方案

重装jdk(不能是openjdk!)
-> 配置环境 -> 重启idea -> 完美解决!

idea中 使用maven出现 No compiler is provided in this environment. Perhaps you are running on a JRE rathe

没有成功更换jdk?

参考文章:https://blog.****.net/wckjlu/article/details/70155037
删除几个文件就好了