Skip to content

Common Problems

Scott Kurz edited this page Feb 8, 2021 · 2 revisions

COMPILATION ERROR - Java 5 not supported

SYMPTOM

[INFO] Compiling 4 source files to /projects/target/classes
INFO] -----------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -----------------------------------------------------
[ERROR] Source option 5 is no longer supported. Use 6 or later.
[ERROR] Target option 1.5 is no longer supported. Use 1.6 or later
[INFO] 2 errors 
[INFO] --------------------------------------------------

SOLUTION

  1. Upgrade to a later level like Java 11 with this in your pom.xml project properties:
<properties>
    <maven.compiler.target>11</maven.compiler.target>
    <maven.compiler.source>11</maven.compiler.source>
</properties>
  1. Upgrade to a more recent-level of the maven-compiler-plugin (which defaults to a later version of Java). E.g.
    <build>  
      <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
        </plugin>

EXPLANATION

The stack container uses Java 11, which doesn't support targeting Java 5 with the compiler, as the default version of maven-compiler-plugin uses. You either need to explicitly target a newer level, (in which case you can continue using the default version of the maven-compiler-plugin, or use a newer version of maven-compiler-plugin, which targets a newer level, by default.

DEV MODE NOT PICKING UP CHANGES EDITING FILES IN VIM

Try adding this to .vimrc:

set backupcopy=yes