在使用maven打包的时候碰到了这个错误:
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
解决办法:
在pom.xml中的build----》plugins中添加
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<fork>true</fork>
<!--指定你的jdk地址-->
<executable>
D:\Program Files\Java\jdk1.8.0_162\bin\javac.exe
</executable>
</configuration>
</plugin>
本文详细介绍了在使用Maven进行项目打包时遇到的错误:Nocompilerisprovidedinthisenvironment.PerhapsyouarerunningonaJREratherthanaJDK?并提供了解决方案,即在pom.xml文件的build插件中配置maven-compiler-plugin,指定JDK路径。
7300

被折叠的 条评论
为什么被折叠?



