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

4

u/HlCKELPICKLE Jun 03 '23

I'm sure everyone here knows what "free" means in the context of open source. The thing is these build tools are free, open source, and do not require an ide at all. You can code a java/javafx application in nano if you want and use maven/gradle without any ide. Everything they are doing is open and you can review the source and the javac and various build components if you want to know more.

Also how does kotlin not exist on debian, kotlin will run where ever you can have a JRE installed.

But the main issue just pure javafx is the limited java run time that is used on android. Javafx isn't as popular as other framework so it compatibility with android is limited and since it has now outgrown the language features android supports and there is little incentive to maintain a subset of android compatible packages for all of the components you are pretty much left using alternatives or gluon's native compilation.

But pure javafx on android is todays obsolete, and kotlin is the language of choice for android and is where all the support is, it may be tomorrows obsolete, anything can be and will be in tech, but android depends heavily on JRE and google has pivoted to kotlin for all their modern support.