最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - Name of Maven dependency for JavaFX - Stack Overflow

programmeradmin3浏览0评论

I looked for a solution to this question but have not found anything:

What is this library .openjfx:javafx-swing:jar:win:14.0.1:compile?

What bothers me is the word "win". I am using a reference like this in my pom file

<dependency>
  <groupId>.openjfx</groupId>
  <artifactId>javafx-swing</artifactId>
  <version>14.0.1</version>
</dependency>

but the dependency plugin complains that this library is missing.

Can anyone please provide a hint in the right direction?

I looked for a solution to this question but have not found anything:

What is this library .openjfx:javafx-swing:jar:win:14.0.1:compile?

What bothers me is the word "win". I am using a reference like this in my pom file

<dependency>
  <groupId>.openjfx</groupId>
  <artifactId>javafx-swing</artifactId>
  <version>14.0.1</version>
</dependency>

but the dependency plugin complains that this library is missing.

Can anyone please provide a hint in the right direction?

Share Improve this question edited Mar 17 at 17:42 Basil Bourque 341k123 gold badges936 silver badges1.3k bronze badges asked Mar 17 at 16:46 CristiCristi 7462 gold badges18 silver badges33 bronze badges 5
  • 3 That pom snippet doesn't refer to win - can you clarify? 14.0.1 is a valid version, although it's nearly 5 years old. – Andrew S Commented Mar 17 at 16:54
  • 3 Do you really need the javafx-swing module? That is for combining JavaFX components with Swing components, which is a bit of an edge use case. Typically you would use javafx-controls, and if you are using FXML use javafx-fxml in addition. I recommend letting your IDE handle all of this; in IntelliJ, for example (and others are similar), you can just use the "New Project" wizard and ask it to set up a JavaFX project. – James_D Commented Mar 17 at 19:15
  • 1 Can you provide a minimal reproducible example POM? – Slaw Commented Mar 17 at 19:27
  • Yes. This is really a combination of Swing with JavaFX components in a legacy project. – Cristi Commented Mar 18 at 7:18
  • This is a rather big proprietary project and it is hard to provide a minimum reproducible example. However the question I asked was already answered. I did not know about the classifier options in the dependency specification. – Cristi Commented Mar 18 at 7:41
Add a comment  | 

1 Answer 1

Reset to default 4

Here is the listing on mvnrepository (circa 17 April 2020):

https://mvnrepository/artifact/.openjfx/javafx-swing/14.0.1

The "win" value is the <classifier> meaning that this dependency is Windows-specific.

<dependency>
    <groupId>.openjfx</groupId>
    <artifactId>javafx-swing</artifactId>
    <version>14.0.1</version>
    <classifier>win</classifier>
    <scope>compile</scope>
    <type>jar</type>
</dependency>
发布评论

评论列表(0)

  1. 暂无评论