Skip to content

Ensure compatibility with Java 1.6 and 1.7 when running Maven using 1.8 #95

@jstuyts

Description

@jstuyts

When you build the project using Java 1.8, the compiler has access to all the classes from Java 1.8. This could cause problems at run time in a 1.6 JVM or 1.7 JVM (Hadoop extension), where 1.8 classes are not available.

This is unrelated to #93, which will allow Java 1.8 syntax. Although I have a slight fear that using that syntax might accidentally introduce a dependency on a 1.8 class.

The way to handle this correctly, is it to add compiler argument bootclasspath to the compiler plug-in configuration, pointing to the correct rt.jar. But this puts a burden on each developer as it requires that both JRE 1.6 and JRE 1.7 are installed, and the developer has to set environment variables to point to those JREs.

A solution might be to allow development with Java 1.8 only, and to check if no classes from newer JDKs are used in the modules on the build server. If someone does introduce a future class, then the build for that PR will fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions