0

I am trying to package and run through the command prompt, a program I developed two years ago. The program runs out of a jar on my Windows Desktop when I compile the Jar on Windows, but when I compile it from my Mac, using the menu for creating the Jar file, and then building the artifact, IntelliJ produces 9 files, a Jar for the program and 8 jars which are produced with javafx-like wording pictured here. The project was originally developed in Java 1.8 and I am trying now to compile it using Java 17.0.2. Could anyone tell me what I might be doing wrong?Image of 9 jars

  • Did you use any JavaFX classes? You said this is a console app. But some programmers have been known to use a few of the JavaFX classes in non-GUI apps. An observable collection, and a “pair” tuple are two in my vague recollection. – Basil Bourque Oct 24 '22 at 05:18
  • The output looks correct to me, as JavaFX modules are required to be on the module path and therefore can not be shaded into a single jar with the application classes. You should be able to run this with `java -p -jar ` – Jorn Vernee Oct 24 '22 at 16:17
  • @BasilBourque This app is a guy app, but I want to run it through the console. – XplicitVariable Oct 24 '22 at 17:30
  • @JornVernee I will try that and let you know if it worked – XplicitVariable Oct 24 '22 at 17:31
  • @JornVernee It did not work. It says that JavaFX runtime components are missing, and are required to run this application – XplicitVariable Oct 24 '22 at 17:37
  • 1
    You’ll need to explain more by what you mean about running your GUI app on the console — that’s contradictory. – Basil Bourque Oct 24 '22 at 17:38
  • Study the [getting started documentation for JavaFX](https://openjfx.io/openjfx-docs/). Ensure you can accomplish your objective with the provided hello, world app, then apply whatever you learned from that to your pre-existing project. In general, you would be likely be better off looking into alternate packaging such as jlink or jpackage than jar distributions for JavaFX apps. – jewelsea Oct 24 '22 at 19:58
  • https://stackoverflow.com/questions/52653836/maven-shade-javafx-runtime-components-are-missing – Slaw Oct 25 '22 at 11:18

0 Answers0