Randa ElBehery
Randa ElBehery

Reputation: 167

Maven failed to execute goal compile

I am compiling a simple maven application using mvn compile on Solaris server from terminal and I get the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project maven-demo: Compilation failure -> [Help 1]

this is my pom.xml

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>MavenTest</groupId>
  <artifactId>maven-demo</artifactId>
  <version>0.0.1-SNAPSHOT</version>

    <properties>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>
    </properties>

    <build>
        <plugins>
            <plugin> 
                 <artifactId>maven-compiler-plugin</artifactId> 
                 <version>3.6.1</version> 
                 <configuration>         
                     <fork>true</fork>
                     <source>1.8</source>
                     <target>1.8</target>
                     <executable>/usr/jdk/instances/jdk1.8.0</executable> 
                 </configuration> 
            </plugin> 
        </plugins>
    </build>

    </project>

Upvotes: 0

Views: 1260

Answers (1)

J Fabian Meier
J Fabian Meier

Reputation: 35823

Your <executable> is not javac. Instead of the directory, you need to specify the complete path.

Upvotes: 1

Related Questions