3

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?

Community
  • 1
  • 1
Stegger
  • 75
  • 1
  • 6

1 Answers1

0

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'
jns
  • 6,017
  • 2
  • 23
  • 28