【项目编译错误处理】Perhaps you are running on a JRE rather than a JDK

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------

**中文描述:**此环境中未提供编译器,你可能使用jre运行而不是jdk。
**引发原因:**Eclipse默认在jre上运行,maven install 编译需要jdk中的编译器,而jre中并没有
**问题解决:**
![Window->Preferences](https://upload-images.jianshu.io/upload_images/4321745-26ae551dd46f7f11.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

![Java->Installed JREs->Add](https://upload-images.jianshu.io/upload_images/4321745-08ea0285678e7db1.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

![Directory...](https://upload-images.jianshu.io/upload_images/4321745-256ce6e3968d2bd8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

![jdk->ok](https://upload-images.jianshu.io/upload_images/4321745-acf5aa5caebf5331.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

![Java->Installed JREs->Execution Environments->JavaSE-1.7->jdk1.x](https://upload-images.jianshu.io/upload_images/4321745-911295f3c7804b5a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

![Java->Installed JREs->Execution Environments->JavaSE-1.8->jdk1.x](https://upload-images.jianshu.io/upload_images/4321745-2346a4e9355e6fe0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![maven->install(编译成功)](https://upload-images.jianshu.io/upload_images/4321745-2b6f50ac8c4bd30b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

**参考文章**
1. [Maven Install报错:Perhaps you are running on a JRE rather than a JDK?](https://www.jianshu.com/p/1ed0ec397575)


你可能感兴趣的:(【项目编译错误处理】Perhaps you are running on a JRE rather than a JDK)