Maven error :Perhaps you are running on a JRE rather than a JDK?

maven打包时报错,JDK1.8

解决方案如下:

pom.xml里面添加

<plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <fork>true</fork>
                    <executable>C:\Program Files\Java\jdk1.8.0_131\bin\javac</executable>
                </configuration>
            </plugin>

 

posted @ 2018-08-07 20:37  小破天  阅读(162)  评论(0)    收藏  举报