java - Maven build fails on Ubuntu 12.04, JDK1.7 -
my maven build fine on windows machine fails compilation error on ubuntu.
[error] failed execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project [xxx]: compilation failure: compilation failure: [error] /usr/share/tomcat7/[xxx]:[24,23] error: no suitable constructor found xxx [error] [error] constructor xxx not applicable [error] (actual argument class<xxx> cannot converted class<? extends xxx> method invocation conversion) [error] constructor xxx not applicable [error] (actual , formal argument lists differ in length) [error] /usr/share/tomcat7/[xxx]:[36,24] error: no suitable constructor found xxx) [error] -> [help 1]
cat /etc/lsb-release
distrib_id=ubuntu distrib_release=12.04 distrib_codename=precise distrib_description="ubuntu 12.04.4 lts"
java -version
java version "1.7.0_51" openjdk runtime environment (icedtea 2.4.4) (7u51-2.4.4-0ubuntu0.12.04.2) openjdk client vm (build 24.45-b08, mixed mode, sharing)
mvn -version
apache maven 3.0.4 maven home: /usr/share/maven java version: 1.7.0_51, vendor: oracle corporation java home: /usr/lib/jvm/java-7-openjdk-i386/jre default locale: en_us, platform encoding: utf-8 os name: "linux", version: "3.5.0-46-generic", arch: "i386", family: "unix"
i tried building on java 1.6 , changing java oracle-7-jdk...
error stays same.
can me?
edit
i have installed oracle jdk according provided instructions
now looks this:
java -version
java version "1.7.0_51" java(tm) se runtime environment (build 1.7.0_51-b13) java hotspot(tm) client vm (build 24.51-b03, mixed mode)
mvn -version
apache maven 3.0.4 maven home: /usr/share/maven java version: 1.7.0_51, vendor: oracle corporation java home: /usr/lib/jvm/java-7-oracle/jre default locale: en_us, platform encoding: utf-8 os name: "linux", version: "3.5.0-46-generic", arch: "i386", family: "unix"
build still fails same error message
update pom file use up-to-date maven-compiler-plugin version (you using 2.0.2 extremly old).
<project> ... <build> <pluginmanagement> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <version>3.1</version> <configuration> <!-- put configurations here --> </configuration> </plugin> </plugins> </pluginmanagement> </build> ... </project>
Comments
Post a Comment