Skip to content

Document how to fix "compiled for target 1.7" error #40

@manuel-mauky

Description

@manuel-mauky

When running a small build script like this:

plugins {
    id "org.frege-lang" version "0.8"
}

apply plugin: "java"

dependencies {
    compile "org.frege-lang:frege:3.22.367-g2737683"
    compile "org.frege-lang:fregefx:0.3.1"
}

I get compile errors like this:

E <PATH>/examples/fregefx/src/main/frege/example/fregefx/HelloFrege.fr:7: cannot import fregefx.JavaFxUtils
    compiled for target  1.7 (without lambda support)
    when the current target  1.8 has lambda support
    Try to use compiler option -target 1.7
example.fregefx.HelloFrege: build failed because of compilation errors.

While the error somehow points out what's wrong, I had a hard time finding out how to solve this issue. It seems that there are other users too that have the same error, see Frege/frege#275.

To fix this I've changed my build file like this:

plugins {
    id "org.frege-lang" version "0.8"
}

apply plugin: "java"

compileFrege {
    target = 1.7
}
compileTestFrege {
    target = 1.7
}

dependencies {
    compile "org.frege-lang:frege:3.22.367-g2737683"
    compile "org.frege-lang:fregefx:0.3.1"
}

To lower the hurdle for new users it would be super if this would be documented in the README file.

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