JavaFX 2作为Maven依赖项 [英] JavaFX 2 as a Maven dependency

查看:431
本文介绍了JavaFX 2作为Maven依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在pom.xml中将JavaFX 2.0作为Maven中的依赖项引用,以便一切顺利进行?

Is it possible to reference JavaFX 2.0 as a dependency in Maven in the pom.xml so that everything works smoothly?

我在这个问题可以在本地安装jfxrt.jar,但理想情况下我想要一个更简单的方法没有任何本地黑客可以正确地解决和下载依赖.... ....

I saw in this question that it is possible to install the jfxrt.jar locally, but ideally I'd like a simpler approach where the dependency can be properly resolved and downloaded without any local hacks....

推荐答案

不,这样的解决方案不存在暂时的。我怀疑它会永远,因为从Java 1.7更新2开始,JavaFX与JVM一起安装。计划从Java 1.8(明年)开始在JRE中包含JavaFX。从那时起,你根本就不需要依赖。

No, such a solution doesn't exist for the moment. I doubt that it will ever, since as from Java 1.7 update 2, JavaFX is installed together with the JVM. Plans are to include JavaFX in the JRE as from Java 1.8 (next year). From then on, you wouldn't need a dependency at all.

但是你现在已经可以使用Maven和JavaFX了,因为Maven可以调用Ant任务(antrun插件)和JavaFX发行版提供了超级Ant任务。我在博客上写了这篇文章,但它是用法语写的: Creer un projet Maven倒JavaFX2 。它将引导您完成整个过程。然而,如果你不懂法语,请在文章上留言,我会尽力帮助你或者在 Oracle论坛

However you can use Maven with JavaFX now already, because Maven can call Ant tasks (antrun plugin) and there are super Ant tasks available with the JavaFX distribution. I blogged about it, but it's in French: Creer un projet Maven pour JavaFX2. It walks you through the whole process. Nevertheless, if you don't understand French, leave a comment on the article and I will try to help you or look in here in the Oracle forum

这篇关于JavaFX 2作为Maven依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆