Discussions
Categories
- 197K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.8K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 556 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.4K SQL Developer
- 296.3K Development
- 17 Developer Projects
- 139 Programming Languages
- 293K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 158 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 205 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 468 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
JavaFX application doesnt work on OpenJDK 7

Hi All,
I use the following technologies in my application :
- JavaFX version 2.2.4
- JDK 7 update 6 (Oracle JDK)
- Maven
I can run the resulting jar file in the Oracle JDK/JRE 7u6 and newest.
But I can not get to work OpenJDK 7 using with java -jar command.
Should I put the openjfx package in the bundle with the application ?
What do you think, what shoult I do ?
Thanks,
Best regards.
Answers
-
And the error when you try to execute is?
-
@bouye-JavaNet Error is :
Exception in thread "main" java.lang.NoClassDefFoundError : javafx/application/Application
...
-
Well there you are the JavaFX runtimes are either completely missing on not on the CLASSPATH.
Check your OpenJDK installation to see if you can find jfxrt.jar somewhere (I think on JDK7 it used to be in the jdk/jre/lib folder whereas in JDK8 its is jdk/jre/lib/ext and thus always on the CLASSPATH by default).
It's also possible it's not there at all and you would need to try OpenJDK8 instead of 7.
EDIT - also if you really need to stick with JDK 7, maybe switch to a more recent release of OpenJDK7 as well. May be the runtimes were missing from the original release for some reason.
-
Hi,
please contact the provider of your OpenJDK 7 binary to understand whether they also provide an OpenJFX binary to go along with it, and if so, how to integrate it with your OpenJDK 7 installation.
Dalibor Topic
Principal Product Manager
Java Platform Group @ Oracle
-
Consider using self-contained application packaging for your application.
The Java packaging tools provide built-in support for several formats of self-contained application packages. The basic package is a single folder on your hard drive that includes all application resources and the JRE. The package can be redistributed as is, or you can build an installable package (for example, EXE or DMG format.)
That way you don't have to worry about what JRE may or may not be installed on the target machine (because the app is bundled with a private JRE that gets installed with the app).
For info on the relationship between JavaFX and the OpenJDK, see:
java - JavaFX and OpenJDK - Stack Overflow
java - Why is JavaFX is not included in OpenJDK 8 on Ubuntu Wily (15.10)? - Stack Overflow
-
Yes, there was no trouble with them(exe, msi),
but,
I want to distribute the application with JNLP so need an executable jar.
-
I didn't think OpenJDK supported JNLP, I thought that was just an Oracle JDK thing (that's an independent issue to whether or not JavaFX is installed on your target system).
It seems there is something called iced tea which allows JNLP on OpenJDK: see java - Installing JNLP on Ubuntu for Open JDK 7 - Stack Overflow
I've never used iced tea and don't know about the current status of the project and what platforms it might support.
-
There is no JNLP implementation in OpenJDK, indeed.
Dalibor Topic
Principal Product Manager
Java Platform Group @ Oracle