With the recent increase in the number of companies, development and deployment has been gradually separated, in order to facilitate deployment personnel packaging deployment, developers also gradually farewell to the in Eclipse, export is packaged in a way that is used to packaging with Maven.
When packaging with the MVN package, the console reports the following error message, Packaging failed:
[Info] build failure[info]------------------------------------------------------------------------[ Info] total time: 3.993 s[info] finished at:2015-07-21t16:34:14+08:00[info] final memory: 8m/121m[info]------------------------------------------------------------------- -----[error] failed to execute goalorg.apache.maven.plugins:maven-compiler-plugin:2.5.1: compile (Default-compile) on project rumorsend_web: fatal error compiling: Tools.jar not found:c:\program files\java\jre1.8.0_45\. \lib\tools.jar -> [help 1][error][error] to see the full stack trace of theerrors, re-run maven with the -e switch. [Error] re-run maven using the -x switch toenable full debug logging. [ERROR] [error] for more information about Theerrors and possible solutions, please read the following articles: [Error] [help 1] http://cwiki.apache.org/confluence/display/maven/mojoexecutionexception
Among them, the most important error message is clearly
Tools.jar notfound:c:\programfiles\java\jre1.8.0_45\. \lib\tools.jar
take this information a variety of search engines search, the results are basically need to modify the JAva Library, from the JRE directory to the JDK directory, but it seems to see in Eclipse is a diagram - results shown in 1:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/70/09/wKiom1WwOFeDZ2rFAAAv3C8exkw676.jpg "title=" 51cto with Figure 1.png "alt=" Wkiom1wwofedz2rfaaav3c8exkw676.jpg "/>
Figure -1
and jdk1.8.0_u45 at the time of the install was indeed pointed to the JDK directory, repeatedly in this piece made a variety of changes, the results in the MVN Package The same error was reported, and later on, Maven packaging and Java compilation used a different JDK, and found that this is true,2 :
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/70/09/wKiom1WwOGriNcMwAAOM4_ZoIqo541.jpg "title=" 51cto figure 2.png "alt=" wkiom1wwogrincmwaaom4_zoiqo541.jpg "/> figure -2
so the JDK used to modify MAVEN packaging, again MVN package, finally appeared a long-lost
[INFO] Buildsuccess
Finish.
This article is from the "barrel of fake dog excrement" blog, please be sure to keep this source http://xitongjiagoushi.blog.51cto.com/9975742/1677352
Work accumulation (11)--eclipse Maven Package failed