m2eclipse jre or jdk problem

m2eclipse遇到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.

一切都是照官方的说明,设置eclipse.ini与jvm。

先是参照这里
http://stackoverflow.com/questions/2222560/build-failed-question-maven-jre-or-jdk-problem
发现根本不起作用

window-->perference-->java-->install jres
勾选的确实是jdk,但排在第一位的仍然是 C:\Program Files ...
删除该项,ok

编译时遇到 编码 GBK 的不可映射字符 错误
添加
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
仍然没有用,最后在maven-compiler-plugin中添加<encoding>utf8</encoding> 
得以解决
<plugin>
<artifactId>maven-compiler-plugin</artifactId> 
<version>2.0.2</version> 
<configuration> 
<source>1.5</source> 
<target>1.5</target> 
  <encoding>utf8</encoding> 
</configuration> 
</plugin>

你可能感兴趣的:(java,eclipse,jvm,jdk,maven)