0

created jar file using the javaFX 1.8 where it is working in windows but in linux it throwing an exception

Error: Could not find or load main class {name of the class that is missing} Caused by: java.lang.NoClassDefFoundError: javafx/application/Application.

So i had updated the project using the openfx jar into the project and created the jar since the open source jar is class file version 55 it doesnt complied and executed it in the jDK 1.8 .

Does anyone have the jar package of JAVAFX 1.8 build with class file version 52. So that i can port it to my project and use it.

Vinooooo
  • 15
  • 4
  • 1
    The reason you're getting the error, if I'm not mistaken, is because the Linux distribution of OpenJDK did not include JavaFX—even for version 8—unlike the Oracle distribution for Windows and macOS. Though since JavaFX 11 even Oracle's distribution no longer includes JavaFX (but other distributors do have packages that include JavaFX). – Slaw Jul 27 '21 at 13:29
  • do you know where i can download the java SDK so that incorporate into our project and use it . – Vinooooo Jul 27 '21 at 14:09
  • I don't have a Linux machine so I'm not exactly sure, but I suppose you should research how to install OpenJFX 8 onto your computer. – Slaw Jul 27 '21 at 14:12
  • Research the documentation at: [openjfx.io](https://openjfx.io). That provides numerous suggestions such as using jlink, the [javafx-maven-plugin](https://github.com/openjfx/javafx-maven-plugin), creating fat jars for JavaFX, modular vs non-modular apps, etc. Unfortunately, openjfx.io doesn't currently document what I think is the preferred solution for many applications, which is to use [jpackage](https://openjdk.java.net/jeps/392) to create a platform-specific binary installer for your application (which for RHEL, would be an RPM). – jewelsea Jul 27 '21 at 22:50
  • Related info in a nice blog post: [JavaFX, JLink and JPackage](https://dev.to/cherrychain/javafx-jlink-and-jpackage-h9). – jewelsea Jul 27 '21 at 22:57
  • If you are feeling particularly brave, you could look into using the remarkable [badass-jlink-plugin](https://github.com/beryx/badass-jlink-plugin) as [documented here](https://badass-jlink-plugin.beryx.org/releases/latest/) to package your application for distribution, similar to this [example project](https://github.com/beryx-gist/badass-jlink-example-richtextfx). – jewelsea Jul 27 '21 at 23:28

0 Answers0