1. 程式人生 > >maven工程裡面install時jdk報錯

maven工程裡面install時jdk報錯

錯誤提示:

ERROR:No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK

解決辦法:

1、eclipse選單 - Window - Preferences- Java - Installed JREs 將配置的JRE定位到JDK,例如JRE home:D:\Program Files (x86)\Java\jdk1.6.0_45
2、ALT+F5 進行 update project 。
3、Debug or Run again.

解決後在run as : Maven install,會出現

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building v1 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ v1 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory G:\j2project\v1\src\main\resources
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ v1 ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ v1 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory G:\j2project\v1\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ v1 ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ v1 ---
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ v1 ---
[INFO] Building jar: G:\j2project\v1\target\v1-0.0.1-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ v1 ---
[INFO] Installing G:\j2project\v1\target\v1-0.0.1-SNAPSHOT.jar to C:\Users\Administrator\.m2\repository\hdfs\v1\0.0.1-SNAPSHOT\v1-0.0.1-SNAPSHOT.jar
[INFO] Installing G:\j2project\v1\pom.xml to C:\Users\Administrator\.m2\repository\hdfs\v1\0.0.1-SNAPSHOT\v1-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.945 s
[INFO] Finished at: 2016-06-12T13:23:48+08:00
[INFO] Final Memory: 17M/491M
[INFO] ------------------------------------------------------------------------

表示已經成功!