当前位置: 首页 > 知识库问答 >
问题:

ScalaFX:HelloWorld编译错误

张淳
2023-03-14

我是Scala和SBT的新手,所以我可能会遗漏一些明显的东西。

我试图编译http://www.scalafx.org/docs/quickstart/上的HelloWorld示例

scalaVersion := "2.11.5"

libraryDependencies += "org.scalafx" %% "scalafx" % "8.0.0-R4"
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
[info] Set current project to scalafx (in build file:/home/kvbx/Projects/ScalaFX/)
[info] Compiling 1 Scala source to /home/kvbx/Projects/ScalaFX/target/scala-2.11/classes...
[error] missing or invalid dependency detected while loading class file 'Color.class'.
[error] Could not access term javafx in package <root>,
[error] because it (or its dependencies) are missing. Check your build definition for
[error] missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
[error] A full rebuild may help if 'Color.class' was compiled against an incompatible version of <root>.
[error] missing or invalid dependency detected while loading class file 'Color.class'.
[error] Could not access term scene in value javafx,
[error] because it (or its dependencies) are missing. Check your build definition for
[error] missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
[error] A full rebuild may help if 'Color.class' was compiled against an incompatible version of javafx.
[error] missing or invalid dependency detected while loading class file 'Stage.class'.
[error] Could not access term javafx in package <root>,
...
...

共有1个答案

汝岳
2023-03-14

JavaFX不是OpenJDK8的一部分。我安装了OpenJFX。管用。(谢谢贾斯珀)

 类似资料:
  • 问题内容: 当我在Netbeans中构建并运行程序时,它可以正常工作。但是当我尝试“ mvn compile”时,使用相同的pom.xml文件会出现以下错误: 我的Java版本不是1.3,这里是“ mvn -version”的结果 这是第53行: 问题答案: 问题是在Maven2中默认使用和 您可以通过将其添加到pom中来解决此问题: 将其放在最顶层的父pom中是很实际的,这样您派生的pom不需要

  • 我遇到了一个初学者的编译错误: 我的简单程序: 我尝试使用以下命令编译它: gcc-g-Wall-ansi launch_瓷砖。c-o tiles\u程序 并得到这些错误: 启动_tiles。c: 在函数“main”中: launch_tiles. c: 17:19:错误:预期')'之前';'令牌 launch_tiles. c: 17:19:错误:太少的参数函数'fget' /usr/inclu

  • 当我退出我的应用程序时,这个folloeing错误已经产生。

  • 编译模块com。实例我的包裹。GWT。HelloGWT [INFO]验证新编译的单元 [INFO]在第一次过程中忽略了1个单元,其中包含编译错误 [INFO]编译时将-strict或-logLevel设置为TRACE或DEBUG以查看所有错误 [INFO]在文件:/home/ilsurih/Projects/maven hibernate/src/main/java/com/example/myP

  • 我有以下代码: 我希望它输出“0,1,2,3”并停止,但它输出的是一系列无穷无尽的“0、1、2、3、4、5……” 看起来比较< code>di 如果我只是注释掉< code >,delta=mc[di],我会正常得到“0,1,2,3”。无辜作业有什么问题? 我正在使用Ideone.com g14带-O2选项。

  • 我正在与ATM案例研究一起工作,从Deitel java如何编程第9版。 案例研究在第13章,第546页(万一有人有这本书并想要查看),我确信我的代码是100%如书中所建议的那样。 我已经设置了所有的代码,但当我尝试运行程序时,它给了我以下信息: 当我试图从类路径使用terminal编译类时,它给出了以下错误: 这是正在进行的课程:直截了当地往前走,但我似乎找不到问题所在。有人帮忙吗?