Is Java 9 supported?


(Vadim Lotarev) #1

Dear guru,

I am wondering whether Buildship supports Java 9? I’ve just tried to build project with Java 9 and Buildship added not existing ‘JavaSE-1.9’ library to the project libraries. Is it possible to correct this behavior?

Thanks in advance,
Vadim


(Vadim Lotarev) #2

I managed to solve the problem partially. The following code fixes classpath entry but doesn’t work for ‘prefs’. Everything works when ‘eclipseJdt’ task is invoked directly but failed when ‘Refresh Gradle project’ menu item is selected (default ‘prefs’ is generated). Please advice.

    eclipse {
        jdt {
            javaRuntimeName = "JavaSE-9"
            file.withProperties { p ->
                p['org.eclipse.jdt.core.compiler.compliance'] = '9'
                p['org.eclipse.jdt.core.compiler.source'] = '9'
                p['org.eclipse.jdt.core.compiler.codegen.targetPlatform'] = '9'
            }
        }
    }

Vadim


(Stefan Oehme) #3

@vlotarev please open a bug report, this needs to be fixed in Gradle.


(Vadim Lotarev) #4

Stefan,

Will do. At the moment wouldn’t you advice any workaround? I am wondering why withProperties doesn’t work with Buildship?

Thanks,
Vadim