当前位置: 动力学知识库 > 问答 > 编程问答 >

java - Adding unit test to JavaFXPorts project in NetBeans - issue with Retrolambda

问题描述:

I found some help in this question. So I know that I must use JDK7 in order for unit testing to work.. So I came up with a build sript like this:

buildscript

{

repositories

{

jcenter()

}

dependencies

{

classpath 'org.javafxports:jfxmobile-plugin:1.0.8'

}

}

retrolambda.oldjdk = 'C:/Program Files/Java/jdk1.7.0_79'

apply plugin: 'org.javafxports.jfxmobile'

apply plugin: 'java'

sourceCompatibility = '1.8'

[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

repositories {

jcenter()

}

dependencies

{

testCompile 'junit:junit:4.12'

}

mainClassName = 'AppMain'

jfxmobile

{

javafxportsVersion = '8.60.7'

android

{

applicationPackage = 'com.somename.someapplication'

androidSdk = 'C:/Program Files (x86)/Android/android-sdk' //

}

}

But i keep getting this exception:

Could not get unknown property 'retrolambda' for root project

Any ideas as to how I can fix this?

网友答案:

You have to apply the jfxmobile plugin first, which in turn will add the retrolambda dependency. Then you can configure the retrolambda oldJdk variable. (Pay attention for the camelCase spelling)

buildscript 
{
    repositories 
    {
        jcenter()
    }

    dependencies 
    {
        classpath 'org.javafxports:jfxmobile-plugin:1.0.8'
    }
}

apply plugin: 'org.javafxports.jfxmobile'
apply plugin: 'java'

retrolambda.oldJdk = 'C:/Program Files/Java/jdk1.7.0_79'
分享给朋友:
您可能感兴趣的文章:
随机阅读: