Caolan
Caolan

Reputation: 143

multi-catch statement is not supported in -source 1.6 (use -source 7 or higher to enable multi-catch statement)

I am running a compilation on Jenkins using maven 3.3.9. I get this error on some code but not all:

multi-catch statement is not supported in -source 1.6 (use -source 7 or higher to enable multi-catch statement)

I am compiling with Java 8:

Executing Maven: -B -f /opt/jenkins/workspace/product/product-Content-Operations_RELEASE/pom.xml -s /opt/jenkins/maven/settings.xml clean deploy -U -X -rf :crawlers-module

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T08:41:47-08:00)

Maven home: /opt/apache-maven-3.3.9

Java version: 1.8.0_92, vendor: Oracle Corporation

Java home: /usr/java/jdk1.8.0_92/jre

Default locale: en_US, platform encoding: ANSI_X3.4-1968

OS name: "linux", version: "2.6.18-371.el5", arch: "amd64", family: "unix"

I have verified that it is using Java 8 from the commandline.

Has anyone worked around this? I am stumped.

Upvotes: 1

Views: 4660

Answers (1)

GhostCat
GhostCat

Reputation: 140613

Guessing: somewhere deep in your compile settings, you are actually forcing -source 1.6

So, yes, you are using a JDK 1.8; but your setup wants to restrict itself to Java 1.6; and that of course does not work; as "multi-catch" is "too new" for Java 1.6.

So I would start searching for exactly strings like "1.6" in your build configuration (and output) files.

Upvotes: 2

Related Questions