在pom.xml中添加 < profiles > < profile > < id > default-tools.jar </ id > < activation > < property > < name > java.vendor </ name > < value > Sun Microsystems Inc. </ value > </ property > </ activation > < dependencies > < dependency > < groupId > com.sun </ groupId > < artifactId > tools </ artifactId > < version > 1.6.0 </ version > < scope > system </ scope > < systemPath > C:Program FilesJavajdk1.6.0_02lib ools.jar </ systemPath > </ dependency > </ dependencies > </ profile > </ profiles > 在 <systemPath>C:/Program Files/Java/jdk1.6.0_02/lib/tools.jar</systemPath> 中间 写绝对地址