r/JavaFX • • Jun 01 '23

Help JavaFX for free software development

I'm trying to learn how to use JavaFX to develop "free" cross-platform software.

By cross-platform I mean both mobile and desktop. Java is a natural choice because its original design goal was "write once, run anywhere" and it it now widely used on mobile, desktop and server platforms. JavaFX is a natural choice for an application framework because it is able to target all those platforms.

My idea of "free" includes being able to build software using command line tools that are themselves free software. Ideally I want to be able to use a script invoking javac, jar, dx, aapt and other low-level tools to build an application. Some of the Java IDEs are nominally free software, but they are so huge that the programmer can never really understand what they are doing. Likewise, many build examples on the web show a command line that invokes gradlew, which in turn downloads gradle, which in turn implements recipes that the developer knows nothing about. I'm not dead set against using an IDE like Eclipse that hides many details from programmer, but I do not want to be dependent on a huge IDE that produces an application package by a process that is essentially magic.

The big stumbling block in implementing this concept of "free" cross-platform is the Android implementation of JavaFX. I admire and salute Gluon for supporting the continuing existence of JavaFX on Android. But most of their examples use their proprietary "compile to native code" tools. No doubt there's a big performance advantage for that approach. But I so far have not found a clear example, reasonably current, showing how to build and run a JavaFX "Hello World" using just low-level free tools.

Comments or suggestions would be welcome.

5 Upvotes

27 comments sorted by

View all comments

Show parent comment

0

u/brmdamon Jun 05 '23

No wonder the JavaFX situation is so confusing. Why are they doing that?

3

u/Birdasaur Jun 05 '23

TLDR Cold business profit motive decision.

Details...

As it was explained to me a few years ago by a former Oracle VP... Java (and by extension JavaFX) doesn't make Oracle money. Ellison and his senior execs bet big on competing in the cloud services space. However they were getting their asses kicked by Microsoft and Amazon. So corporate mindset became "every dollar spent must drive business towards our cloud".

They couldn't walk away from Java itself because of the huge prestige hit they would take. At the same time when Java started the switch to the module system they needed to proffer some sacrificial lambs. JavaFX was put on the altar.

Now why wasn't Swing also moved out of the JDK as well? Its also a graphic Window UI toolkit as well.

Hit job.

There were a couple people high up in the Java dev tools group that were Swing stalwarts who had resented the investment in JavaFX from the start. And it was justified because there were several development tools being maintained as part of the Oracle DB suite and it would cost them money to alter their internal dev processes.

2

u/brmdamon Jun 05 '23

Thanks for the background Birdasaur.

Free software would not be where it is today without technical contributions from big corporations - but it seems like its always an uneasy relationship.