Eclisep上构建Maven工程提示:
Unable to locate the Javac Compiler in:
C:\Program Files\Java\jre6\..\lib\tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
-> [Help 1]
解决办法:
1、确定Eclispse使用的是JDK1.6,不是JRE
2、设置编码格式,发现mvn使用的UTF-8, 而代码使用的GBK
所以将代码格式改成UTF-8
参考:http://stackoverflow.com/questions/3317402/eclipse-maven-plugin-configuration-problem
3、修改Maven编译的默认字符集
参考:http://blog.csdn.net/jsjszg/article/details/9237189