linux上输入mvn package后显示No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

问题截图:

pom.xml 中添加javac路径,如果不能使用centos自带的
随便找一个地方重新解压一个jdk.gz就行,不需要安装,不用配环境变量。

             <plugin>
              <artifactId>maven-compiler-plugin</artifactId>
              <version>3.1</version>
              <configuration>
                    <fork>true</fork>
                    <executable>
                        /prod/test/ops/other/javapath/jdk-13.0.2injavac
                    </executable>
               </configuration>
	</plugin>
原文地址:https://www.cnblogs.com/sjj33sda/p/13882891.html