Build errors for spider; org. apache. maven. lifecycle. lifecycleExecutionException: Failed to execute goal org. apache. maven. plugins: maven-compiler-plugin: 2.3.2: compile (default-compile) on project spider: Compilation failure
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.
In fact, this problem was also encountered during the previous setup of the environment, except that eclipse or maven chose an error when using the jre environment, the general solution is to replace the default jre with jdk jre in eclipse.
The method is as follows: window --> Preferences --> java --> Installed JREs
Here you will see a default, and then you click Add... on the right ..., add a new Standard VM, and select the JRE directory under your JDK as jre home. After that, set it as the default. Then, click the sub-menu of Installed JREs, there is a Execution Environments, set the javase you use.
Another solution is to add two lines in the eclipse STARTUP configuration file.
-Vm
C: \ Program Files \ Java \ jdk1.6.0 _ 45 \ bin \ javaw.exe
It should be written in two lines, or before-vmargs.
In some cases, the cause of the problem may be encoding. Set the encoding, engineering encoding, and java file encoding ..
I tried these methods when I encountered this problem yesterday, but I still reported an error. The maven project cannot be compiled. Then I checked the environment variable configuration and found that there was no error. The normal version information can be displayed by inputting java-version and mvn-version. However, when I deleted JAVA_HOME, I entered java-version again to display the normal version information. This is incorrect, but I didn't set the java path environment variable. Instead, you can delete all the java and maven environment variables, reconfigure them, and then open the eclipse compilation project to run normally.