Jenkins error strings in switch are not supported In-source 1.5__jenkins

Source: Internet
Author: User

Jenkins deployment application times wrong:
[ERROR]

/diskc/jenkins/data/workspace/civp_ms/civp_interface/src/main/java/cn/com/geo/cloud/civp/service/query/impl/ Telecomgroup_agel

ABEL_SERVICEIMPL.JAVA:[118,24] Strings in switch are not supported In-source 1.5
(Use-source 7 or higher to enable strings in switch)
[ERROR]

/diskc/jenkins/data/workspace/civp_ms/civp_interface/src/main/java/cn/com/geo/cloud/civp/service/query/impl/ Telecomgroup_bala

NCELABELOFMDN_SERVICEIMPL.JAVA:[126,24] Strings in switch are not supported In-source 1.5
(Use-source 7 or higher to enable strings in switch)


Analysis:

Difficult to Jenkins use the jdk1.5 version of the package compilation.

View the "System Setup" JDK entry for the next Jenkins already using the JDK1.7



Search on the Internet, you need to modify in the Jenkins configuration file


To modify the default JDK version
Cd/root/.jenkins/tools/hudson.tasks.maven_maveninstallation/maven/conf

First back up CP Setting.xml Setting.xml.bak

VI setting.xml File

<!--

Add above the another profile


<profile>
<id>jdk-1.7</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.7</jdk>
</activation>
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
</properties>
</profile>

Set to 1.7 version of JDK

Clean up "Workspace"


Re-build, success

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.