JavaFX在Heroku上无效(NoClassDefFoundError) [英] JavaFX doesn't work on Heroku (NoClassDefFoundError)
问题描述
我的tomcat服务器应用程序中有一些JavaFX,就像一个javafx对,还有一些属性,但是似乎它们在heroku上造成了一个错误:
I have some JavaFX includes in my tomcat server application, like a javafx pair, and some properties, but it seems that they cause an error on heroku:
java.lang.NoClassDefFoundError:javafx / util / Pair
java.lang.NoClassDefFoundError: javafx/util/Pair
我看到它在部署时安装openJDK 1.8战争,所以怎么没有找到JavaFX?
I see that it installs openJDK 1.8 when deploying the war, so how come it doesn't find JavaFX?
推荐答案
Heroku上的JDK是无头的,不包括javafx罐。您可以通过在 pom.xml
中添加如下内容来手动添加:
The JDK on Heroku is headless, and does not include the javafx JAR. You can include it manually by adding something like this to your pom.xml
:
<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>javafx</artifactId>
<version>2016.10.0</version>
</dependency>
该分发由RedHat提供。 Maven Central上还有其他发行版。
That distribution is provided by RedHat. There are other distributions on Maven Central.
这篇关于JavaFX在Heroku上无效(NoClassDefFoundError)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!