# Javafx in Ignition 8 module

**URL:** <https://forum.inductiveautomation.com/t/javafx-in-ignition-8-module/24589>\
**Category:** Module Development\
**Created:** [May 2, 2019, 12:27pm UTC](https://forum.inductiveautomation.com/t/javafx-in-ignition-8-module/24589 "2019-05-02T12:27:25Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![derek.meuwissen](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@derek.meuwissen](https://forum.inductiveautomation.com/u/derek.meuwissen)\
**Post date:** [May 2, 2019, 12:27pm UTC](https://forum.inductiveautomation.com/t/javafx-in-ignition-8-module/24589/1 "2019-05-02T12:27:25Z")

</div>

We have had some Javafx components in our module in Ignition 7.9. Now with the release of Ignition 8.0 we want to make our module work with the new version but we are having some issues with Javafx. We have added the Javafx dependencies to Maven but when we launch the designer with the module we get the following error in the console:  
`java.lang.NoClassDefFoundError: javafx/embed/swing/JFXPanel`

Does anyone have a solution?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 2, 2019, 12:33pm UTC](https://forum.inductiveautomation.com/t/javafx-in-ignition-8-module/24589/2 "2019-05-02T12:33:21Z")

</div>

Can you share your module and/or its pom.xml files?

---

<div class="post-metadata">

**Author:** ![derek.meuwissen](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@derek.meuwissen](https://forum.inductiveautomation.com/u/derek.meuwissen)\
**Post date:** [May 2, 2019, 12:39pm UTC](https://forum.inductiveautomation.com/t/javafx-in-ignition-8-module/24589/3 "2019-05-02T12:39:57Z")

</div>

I can’t upload the files to the forums so here is a pastebin:

client pom: [https://pastebin.com/4L7827wZ](https://pastebin.com/4L7827wZ)  
java class: [https://pastebin.com/qv0FH1ff](https://pastebin.com/qv0FH1ff)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 2, 2019, 12:44pm UTC](https://forum.inductiveautomation.com/t/javafx-in-ignition-8-module/24589/4 "2019-05-02T12:44:45Z")

</div>

If you open the module that gets built can you find those jar files? Are the references to those jars included in the module.xml file?

---

<div class="post-metadata">

**Author:** ![derek.meuwissen](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@derek.meuwissen](https://forum.inductiveautomation.com/u/derek.meuwissen)\
**Post date:** [May 2, 2019, 1:22pm UTC](https://forum.inductiveautomation.com/t/javafx-in-ignition-8-module/24589/5 "2019-05-02T13:22:53Z")

</div>

I’m not exactly sure what you mean by module.xml but when I add the module on the gateway the javafx jars are added to the jar-cache of the module.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 2, 2019, 1:23pm UTC](https://forum.inductiveautomation.com/t/javafx-in-ignition-8-module/24589/6 "2019-05-02T13:23:41Z")

</div>

When you build your module there should be a module.xml file inside of it - can you post that?

---

<div class="post-metadata">

**Author:** ![derek.meuwissen](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@derek.meuwissen](https://forum.inductiveautomation.com/u/derek.meuwissen)\
**Post date:** [May 2, 2019, 2:07pm UTC](https://forum.inductiveautomation.com/t/javafx-in-ignition-8-module/24589/7 "2019-05-02T14:07:40Z")

</div>

Here is my module.xml:  
I am able to find the javafx jars in the module.

[module.xml](https://us1.discourse-cdn.com/inductiveautomation/original/2X/3/3e8803d4e6903306f9103533ea542fcba050c53a.xml) (2.0 KB)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 2, 2019, 2:21pm UTC](https://forum.inductiveautomation.com/t/javafx-in-ignition-8-module/24589/8 "2019-05-02T14:21:07Z")

</div>

Not sure what’s wrong right now. You’ve got duplicate jar entries in the module.xml but I’m not sure if that’s a problem.

If you launch the designer with the java console enabled is there errors?

---

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [May 2, 2019, 4:05pm UTC](https://forum.inductiveautomation.com/t/javafx-in-ignition-8-module/24589/9 "2019-05-02T16:05:17Z")

</div>

The problem is JavaFX is not included with the JVM that ships with the launchers. You will need to add the JavaFX binaries from [openjfx.io](http://openjfx.io) to .ignition\cache\resources\runtimes\someversion and I think it will work.

---

<div class="post-metadata">

**Author:** ![derek.meuwissen](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@derek.meuwissen](https://forum.inductiveautomation.com/u/derek.meuwissen)\
**Post date:** [May 3, 2019, 7:46am UTC](https://forum.inductiveautomation.com/t/javafx-in-ignition-8-module/24589/10 "2019-05-03T07:46:50Z")

</div>

I am not exactly sure how I can show the console with Zulu JRE that has been added to Ignition 8.

---

<div class="post-metadata">

**Author:** ![derek.meuwissen](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@derek.meuwissen](https://forum.inductiveautomation.com/u/derek.meuwissen)\
**Post date:** [May 3, 2019, 7:48am UTC](https://forum.inductiveautomation.com/t/javafx-in-ignition-8-module/24589/11 "2019-05-03T07:48:57Z")

</div>

This worked! I replaced the Zulu JDK with the version that has OpenJFX included and now it works. Unfortunatly adding OpenJFX for every client is not a good solution.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 3, 2019, 11:42am UTC](https://forum.inductiveautomation.com/t/javafx-in-ignition-8-module/24589/12 "2019-05-03T11:42:43Z")

</div>

Ah, right…

Look in `~/.ignition/clientlauncher-data/clientlauncher.log`

You’ll see a line like this:

```auto
INFO [ClientLauncherFrame] [12:40:57,735]: Starting Java with the following parameters:nohup /usr/lib/jvm/java-9-jdk/bin/java -classpath /home/kevin/.ignition/clientlauncher-data/launchclient.jar -Djavaws.sr.gateway.addr.0=10.10.70.68:8088/main -Djavaws.sr.scope=D -Djavaws.sr.launchts=1545079238938 -Djavaws.sr.main=com.inductiveautomation.ignition.designer.DesignerStartupHook -Djavaws.sr.platform.edition= -Xms256M -Xmx1024M -Dsun.java2d.d3d=false com.inductiveautomation.ignition.client.launch.BootstrapSwing & 

```

Copy that launch command and launch a client yourself from a terminal. You should be able to see the logs.

---

<div class="post-metadata">

**Author:** ![derek.meuwissen](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@derek.meuwissen](https://forum.inductiveautomation.com/u/derek.meuwissen)\
**Post date:** [May 3, 2019, 12:19pm UTC](https://forum.inductiveautomation.com/t/javafx-in-ignition-8-module/24589/13 "2019-05-03T12:19:58Z")

</div>

Ah oké got that working. No errors in the client logs though.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 3, 2019, 1:54pm UTC](https://forum.inductiveautomation.com/t/javafx-in-ignition-8-module/24589/14 "2019-05-03T13:54:58Z")

</div>

Can you send a copy of your module via email or DM?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 3, 2019, 2:34pm UTC](https://forum.inductiveautomation.com/t/javafx-in-ignition-8-module/24589/15 "2019-05-03T14:34:54Z")

</div>

Hmm, seems like there’s some missing JARs in the module that gets built.

Try adding explicit dependencies on `javafx-graphics` and `javafx-media`.

When I list your client module’s dependencies with Maven I get this:

```auto
kevin@Kevins-2018-MacBook-Pro ~/D/O/C/corporateidentity-client>
mvn dependency:list -DincludeScope=compile -DexcludeScope=test | grep ".*:.*:.*compile" | cut -d] -f2- | sort -u
    eu.hansolo:Medusa:jar:8.3:compile
    jfree:jcommon:jar:1.0.16:compile
    jfree:jfreechart:jar:1.0.13:compile
    nl.at_automation:corporateidentity-common:jar:1.2.1:compile
    org.openjfx:javafx-base:jar:11:compile
    org.openjfx:javafx-base:jar:mac:11:compile
    org.openjfx:javafx-controls:jar:11:compile
    org.openjfx:javafx-controls:jar:mac:11:compile
    org.openjfx:javafx-graphics:jar:11:compile
    org.openjfx:javafx-graphics:jar:mac:11:compile
    org.openjfx:javafx-media:jar:11:compile
    org.openjfx:javafx-media:jar:mac:11:compile
    org.openjfx:javafx-swing:jar:11:compile
    org.openjfx:javafx-swing:jar:mac:11:compile
    org.openjfx:javafx-web:jar:11:compile
    org.openjfx:javafx-web:jar:mac:11:compile

```

Aside from the fact that you’re missing some of those jars in the final module.xml and module, those system-specific classifiers are gonna be another problem to figure out - the JavaFX jars have native components and you’ll have to package _all_ the variants for every platform you want to support.

You may just need a bunch of explicit dependencies for each javafx artifact, one for the base artifact, and an additional one for each platform for that artifact.

edit: that might not be right, I’m not sure if you can just include _all_ the native artifacts or if you need to somehow get it right for the platform it’s launching on…

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 3, 2019, 2:42pm UTC](https://forum.inductiveautomation.com/t/javafx-in-ignition-8-module/24589/16 "2019-05-03T14:42:15Z")

</div>

It also doesn’t seem like the `ignition-maven-plugin` knows to look at the `<classifier>` element on a dependency and treat it differently, so we might be kinda stuck right now.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 3, 2019, 2:58pm UTC](https://forum.inductiveautomation.com/t/javafx-in-ignition-8-module/24589/17 "2019-05-03T14:58:32Z")

</div>

Ant to the rescue? /-:

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 3, 2019, 3:00pm UTC](https://forum.inductiveautomation.com/t/javafx-in-ignition-8-module/24589/18 "2019-05-03T15:00:49Z")

</div>

Or maintain the module.xml by hand and write a small shell script to collect the dependencies and zip everything up. It’s pretty easy, some of the first modules I wrote years ago were built that way.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 3, 2019, 3:03pm UTC](https://forum.inductiveautomation.com/t/javafx-in-ignition-8-module/24589/19 "2019-05-03T15:03:06Z")

</div>

I’m doing a similar thing with a run-once python script to soft-link all my dependencies and ant to build and package and sign. Very flexible.

---

<div class="post-metadata">

**Author:** ![derek.meuwissen](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@derek.meuwissen](https://forum.inductiveautomation.com/u/derek.meuwissen)\
**Post date:** [May 3, 2019, 3:04pm UTC](https://forum.inductiveautomation.com/t/javafx-in-ignition-8-module/24589/20 "2019-05-03T15:04:16Z")

</div>

That doesn’t sound that bad. Will give it a try.
