1

oh my god, isn't it fun to compile old code...

The problem now is compiling old war with jdk6 running mvn clean package will produce following error:

[ERROR] Source option 6 is no longer supported. Use 7 or later.
[ERROR] Target option 6 is no longer supported. Use 7 or later.

Sure, i understand its bit old but this application wont compile with jdk7 ...

i have tried using targets in pom.xml

<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>

inside properties and then separately

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

Any combination of these will give same error, or im doing something wrong...

I've already had hours of fun looking packages for JDK 6 today. Please send help

Clomez
  • 1,410
  • 3
  • 21
  • 41
  • 3
    You probably need to set JAVA_HOME to point to a Java 6 JDK, and possibly use an older Maven version. – Mark Rotteveel Jan 02 '20 at 15:02
  • 1
    Check these answers : https://stackoverflow.com/questions/36141186/what-version-of-maven-is-compatible-with-java-6 && https://stackoverflow.com/questions/49028810/error-source-option-1-5-is-no-longer-supported-use-1-6-or-later – Poutrathor Jan 02 '20 at 15:05
  • 1
    What JDK are you using? What do you get when you invoke `java -version` ? – J Fabian Meier Jan 02 '20 at 15:08
  • 2
    If you need to build for JDK 6 there are at least two solutions. First using JDK 8+ to run Maven itself and via [Toolchains let the tests/compiling](https://maven.apache.org/guides/mini/guide-using-toolchains.html) run with JDK 6 if you have one available. The other solution would be to use JDK 8+ (up to JDK 10 most recent possible which supports target of 6) and set source/target according to Java 6 best would be to set `release` for JDK9+ – khmarbaise Jan 02 '20 at 20:07

0 Answers0