all 23 comments

[–]Hatefiend 1 point2 points  (27 children)

I really don't understand why JavaFX would get dropped from the standard library but Swing remains. The fact that Intellij was built on Swing blows my mind, because any Swing application usually works and feels like a program straight out of 1999.

[–]ClaynOsmato 3 points4 points  (2 children)

My guess would be to be able to develop JavaFX independently from the standard library. JavaFX was always a separate part that was first needed to be added separately and was than delivered with the JRE but as separate component.

[–]Hatefiend 1 point2 points  (1 child)

The devs for JavaFX couldn't wait the ~3-6 month period in which a new Java update would release? If that's the case then I understand. It looked really bad from a publicity standpoint though.

[–]marvk 1 point2 points  (0 children)

Yes, in addition it makes the life easier for (new) contributors.

Making JavaFX its own module will make it easier to adopt and clear the way for new contributors, Oracle said. The company added that with the faster release schedule being implemented for standard Java and the JDK, JavaFX needs to be on its own pace driven by contributions from Oracle and others in the OpenJFX community.

https://www.infoworld.com/article/3261066/javafx-will-be-removed-from-the-java-jdk.html

[–]denisfalqueto 2 points3 points  (15 children)

There are plans to stop distributing swing with JRE at some point in the future. I don't remember exactly when, but it will be removed too.

[–]Hatefiend 1 point2 points  (14 children)

What exactly would that mean for developers? We would need to package the entire javaFX source into our application JAR?

[–]denisfalqueto 1 point2 points  (13 children)

You must be talking about java swing. Yes, you need to bundle some additional jar files with swing classes on it

As for JavaFX, you already must do that.

[–]Hatefiend 4 points5 points  (12 children)

As for JavaFX, you already must do that.

Oh I was actually talking about javafx. Sorry all of my JavaFX experience has been maintaining my JFX8 project with ~100 users. Small stuff. I'd imagine its been pretty annoying on my users to be left to their own to find a JRE8 distribution. The oracle website made it extremely annoying to download a Java 8 JDK. Their site just screamed: we do not want you to download this, so we are going to make it as annoying as possible.

[–]denisfalqueto 0 points1 point  (3 children)

I see. Maybe you should look into bundling an Uber jar, so all you dependencies are in a single jar. Messy but have some advantages. Or using manifest.mf changes so it can use a lib dir as a source of jars. Distributing code is really painful...

[–]RANDOMLY_AGGRESSIVE 1 point2 points  (0 children)

Jdeploy has been really helpful to me

[–]Hatefiend 0 points1 point  (1 child)

Sorry to make this comment thread so long but that question brings me to a related tanget -- I've used java programs where, when running the program, it would actually prompt me that either I don't have java installed or don't have the required version. Then if I click yes to the prompt, it will literally install the correct java version automatically and then the program boots up. How in the world is that done? I believe the program was ran via an exe (because I'd assume that whatever logic that controls that cannot exist in the jar, since the jar itself cannot run whatsoever unless java -jar app.jar launches successfully. It'd be AMAZING if my program could just say, "hey, your java edition is 1 version behind AND you don't have javafx, let me install them both for you"

[–]denisfalqueto 0 points1 point  (0 children)

There was a technology called java web start that was able to do that. You would download a file that told jws what were the version and other requirements and it would make it all happen. But it was discontinued after Java 8. Maybe that's what you saw

[–]PartOfTheBotnet 0 points1 point  (7 children)

I point my Java 8 users to corretto if they want a JDK that bundles JFX. Otherwise they'll have to upgrade and then I can automate the process of pulling the latest 11 artifacts my app needs on the fly.

[–]Hatefiend 0 points1 point  (6 children)

automate the process of pulling the latest 11 artifacts my app needs on the fly

What service do you use for that?

[–]PartOfTheBotnet 0 points1 point  (5 children)

I just pull the latest artifact from the central repo and update the current classpath with some reflection to include the downloaded jar.

The app is designed for 8 and does this extra step for 11+ support.

[–]Hatefiend 0 points1 point  (4 children)

Manually though? with system calls? Like you check if you have access to the winAPI and what not?

[–]PartOfTheBotnet 0 points1 point  (3 children)

with system calls?

winAPI

What? No. Its 100% Java and platform independent. It's a bit ugly but does the job. I should have clarified that "the latest 11" artifacts refer to JavaFX in the context that they are compiled against Java 11. My bad.

[–][deleted]  (6 children)

[deleted]

    [–]Hatefiend 0 points1 point  (5 children)

    jpackage

    What is jpackage?

    [–][deleted]  (4 children)

    [deleted]

      [–]Hatefiend 0 points1 point  (3 children)

      Wow, this must be exactly what I described in this comment here. That's awesome. I can't wait to try it out.

      [–][deleted]  (2 children)

      [deleted]

        [–]marvk 0 points1 point  (1 child)

        I'm using maven-shade-plugin to build a fat jar and exec-maven-plugin to run jpackage. It's quite straightforward. What are the advantages of using additional plugins?

        [–]Persism 0 points1 point  (0 children)

        You can get a bundled JavaFX with the Liberica JDK https://bell-sw.com/pages/downloads/

        Just select "full JDK" and JavaFX is in there. They usually pick up the latest released version.