Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

651
Vistas
java 1.7+ is not supported in -source 1.5 errors

I'm getting all sort of java errors not supported in -source 1.5 when creating my Maven Install in eclipse. There is nothing wrong with my code.

Errors follows:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1
[23,62] multi-catch statement is not supported in -source 1.5 
[241,29] try-with-resources is not supported in -source 1.5
[156,64] diamond operator is not supported in -source 1.5

My pom configuration follows:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.2.3</version>
        <configuration>
            <source>1.8</source>
            <target>1.8</target>
            <encoding>UTF-8</encoding>
        </configuration>
    </plugin>
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Add the following lines in your pom.xml file should resolve your problem.

<properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
</properties>

If you may take in consideration the advises that were provided to you. You would have 2 options to choose from:

Option 1) If you keep the maven-war-plugin. Update version to the latest then add the properties with the compiler info and sourceEncoding but remove the configuration lines:

<properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
    
    ..
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.3.1</version>
    </plugin>
    ..
</build>

Option 2) If you replace maven-war-plugin with the maven-compiler-plugin ** There are no need to add/replace the source, target and encoding to the properties**. Make sure to update the version to the latest:

<build>
    ..
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
            <source>1.8</source>
            <target>1.8</target>
            <encoding>UTF-8</encoding>
        </configuration>
    </plugin>
    ..
</build>
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda