用idea工具对java打包:命令 mvn clear package,报错
网上都是eclipse的,要么是project structure和setting的(当然这俩也要用)
我都试了,每一个能用的,最后是这样,在pom里添加plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<verbose>true</verbose>
<fork>true</fork>
<executable>${JAVA_HOME}/bin/javac</executable>
</configuration>
</plugin>
<JAVA_HOME>C:\Program Files\Java\jdk1.8.0_191</JAVA_HOME>
此方法我试了一下,没搞定,添加如下方法搞定:
<build>
<plugins> <plugin> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<verbose>true</verbose>
<fork>true</fork>
<!--suppress UnresolvedMavenProperty -->
<executable>C:/Java/jdk1.8.0_181/bin/javac</executable>
</configuration>
</plugin> </plugins>
</build>
如下图: