I have some projects compiled and deployed with Maven and Jenkins, and they still worked fine, that I changed the java version from 6 to 7.
To do this, I ran the sudo update-alternatives --config javac command and changed the JAVA_HOME and PATH values ββin the / etc / profile file. I also changed the pom file, so it uses jdk 1.7:
<properties> ... <jdk.version>1.7</jdk.version> </properties> <plugin> <artifactId>maven-compiler-plugin</artifactId> ... <configuration> <source>${jdk.version}</source> <target>${jdk.version}</target> </configuration> </plugin>
When I execute them on the console, they compile in perfect order and the displayed version is correct:
javac -version javac 1.7.0_55 mvn install -debug Apache Maven 2.2.1 (rdebian-8) Java version: 1.7.0_55 Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
However, when I do the same in jenkins work, Maven uses version 1.6 instead of 1.7:
javac -version javac 1.7.0_55 mvn install -debug Apache Maven 2.2.1 (rdebian-8) Java version: 1.6.0_31 Java home: /usr/lib/jvm/java-6-openjdk-amd64/jre
I also changed the maven configuration file, which I use to indicate the new version, and in the Jenkins admin panel, I changed the version of the JDK. However, Maven still uses 1.6 jdk.
Do you know how I can change it?
java linux maven jenkins
rafaborrego
source share