gradle linux找不到包,Gradle编译在Linux上找不到tornadofx

我想用gradle编译一个kotlin应用程序。该应用程序使用tornadofx(javafx的kotlin版本)。Gradle编译在Linux上找不到tornadofx

在build.gradle,我有:

dependencies {

compile fileTree(dir: 'libs', include: ['*.jar'])

compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

compile 'no.tornado:tornadofx:1.7.8'

compile 'com.squareup.moshi:moshi:1.5.0'

compile 'com.squareup.moshi:moshi-kotlin:1.5.0'

// Required for local unit tests (JUnit 4 framework)

testCompile 'junit:junit:4.12'

}

在MyApp.kt我:

import javafx.application.Application

import tornadofx.App

当我在Windows上编译10这个项目,无论是与gradle clean build或.\gradlew clean build,它编译和完美的作品。

当我编译在Ubuntu Linux这个项目,我得到错误信息的页面,其中包括:

...

e: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:

class tornadofx.UIComponent, unresolved supertypes: javafx.event.EventTarget

class tornadofx.App, unresolved supertypes: javafx.application.Application

...

e: /home/al/project/app/src/pcUi/MyApp.kt: (3, 8): Unresolved reference: javafx

e: /home/al/project/app/src/pcUi/MyApp.kt: (12, 5): Unresolved reference: Application

...

虽然如果我这样做,从一个干净的设置,在gradle这个输出还包括:

Download https://jcenter.bintray.com/no/tornado/tornadofx/1.7.8/tornadofx-1.7.8.pom

Download https://jcenter.bintray.com/com/squareup/moshi/moshi/1.5.0/moshi-1.5.0.pom

Download https://jcenter.bintray.com/com/squareup/moshi/moshi-parent/1.5.0/moshi-parent-1.5.0.pom

Download https://jcenter.bintray.com/com/squareup/moshi/moshi-kotlin/1.5.0/moshi-kotlin-1.5.0.pom

Download https://jcenter.bintray.com/org/glassfish/javax.json/1.0.4/javax.json-1.0.4.pom

Download https://jcenter.bintray.com/org/glassfish/json/1.0.4/json-1.0.4.pom

Download https://jcenter.bintray.com/net/java/jvnet-parent/3/jvnet-parent-3.pom

Download https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jre8/1.1.3/kotlin-stdlib-jre8-1.1.3.pom

Download https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-reflect/1.1.3/kotlin-reflect-1.1.3.pom

Download https://jcenter.bintray.com/com/squareup/okio/okio/1.13.0/okio-1.13.0.pom

Download https://jcenter.bintray.com/com/squareup/okio/okio-parent/1.13.0/okio-parent-1.13.0.pom

Download https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jre7/1.1.3/kotlin-stdlib-jre7-1.1.3.pom

Download https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib/1.1.3/kotlin-stdlib-1.1.3.pom

Download https://jcenter.bintray.com/no/tornado/tornadofx/1.7.8/tornadofx-1.7.8.jar

Download https://jcenter.bintray.com/com/squareup/moshi/moshi/1.5.0/moshi-1.5.0.jar

Download https://jcenter.bintray.com/com/squareup/moshi/moshi-kotlin/1.5.0/moshi-kotlin-1.5.0.jar

Download https://jcenter.bintray.com/org/glassfish/javax.json/1.0.4/javax.json-1.0.4.jar

Download https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jre8/1.1.3/kotlin-stdlib-jre8-1.1.3.jar

Download https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-reflect/1.1.3/kotlin-reflect-1.1.3.jar

Download https://jcenter.bintray.com/com/squareup/okio/okio/1.13.0/okio-1.13.0.jar

Download https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jre7/1.1.3/kotlin-stdlib-jre7-1.1.3.jar

Download https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib/1.1.3/kotlin-stdlib-1.1.3.jar

这对我来说没有任何意义,因为它正确地下载了依赖关系(在Linux和Windows上),但是只能成功地在Windows而不是Linux上编译。我一直无法弄清楚发生了什么,所以任何人都可以提供任何建议,看看哪里?

2017-08-08

DrAl

+0

假设您使用OpenJDK,默认情况下JavaFX不包含在Oracle JDK中,因此您可能需要安装它或切换到Oracle。 –

+3

如果你在Ubuntu上,它就像'sudo apt-get install openjfx'一样简单。 –

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值