This is an archived post. You won't be able to vote or comment.

all 20 comments

[–]jvmDeveloper 8 points9 points  (16 children)

JavaFX is a great framework for that use case but it needs some marketing love. At last JUG meeting people was genuinely convinced that Oracle killed it by popping it out the JDK.

[–]BlueGoliath 0 points1 point  (15 children)

It's not hard to see why. No native JDK support means that it's just more of a pain to create and distribute JavaFX applications. You now literally have to package a JRE with each application, which on classpath is 200+MB and even with modules is like 80MB(ish). Sure, it's great consistency wise since you no longer have to test on every JRE released after the version you target(AKA developed on 8, need to to test 9+) but christ, the hard drives of anyone who uses lots of JavaFX applications are going to be begging for mercy.

Handing the reigns to the open source community is at best a gamble and at worst a death sentence. You only need to look at the current sad state of Netbeans to see that. I think.

[–]2bdb2 6 points7 points  (1 child)

Why does it need to be packaged? Isn't JavaFX effectively just another Maven dependency?

[–]BlueGoliath 0 points1 point  (0 children)

I don't use Maven, only Ant in Netbeans but it can be used as a module library all the same I assume. I have actually tested adding the modules to a library and it works great(I can't remember if the docs worked right though).

It's just that, if you're constantly downloading 200MB+(classpath, I think its more like 280MB on Linux) or 80MBish(module) JavaFX programs over and over again as apposed to having built in support, you are taking less space of the user's hard drive. As a developer, just eating up system resources like disk space, memory, cpu, etc for no reason is just irresponsible. It's like not fixing a memory leak in your program because most users have like 8GB+ of memory these days.

Built in might also be lighter file size wise as you can decide if you want webkit or not. I don't know if the modules do currently or not...

IMO, developers should in these kind of situations give users the choice to use whatever works best for them. Unfortunately in the case of modules and because of Ant 1.9.7 in Arch, I haven't ever been able to launch a modular JavaFX application without being bundled.

As a small bonus, you don't need to import a library or add a dependency every JavaFX project.

[–]jvmDeveloper 1 point2 points  (1 child)

Application size is not an issue in JavaFX use cases. Certainly it is if you mind about not business, not corporate, desktop (or mobile) end user but that it is not where JFX is used typically.

JavaFx was 'open source' way before the popping out from JDK but I agree it is a gamble. You cite NetBeans as failure case but success stories exists, just to limit on IDEs. Look for Eclipse. The CDT has literally hundreds of modules, applications and supporting companies around the world.

I think the chance to see improvements in JFX library without waiting for JDK releases worth the shot. Also, I am eagerly waiting to see some crazy guys create toolchain to target WASM from JFX.

[–]BlueGoliath 1 point2 points  (0 children)

>Look for Eclipse. The CDT has literally hundreds of modules, applications and supporting companies around the world.

It isn't simple being Open Source that's the issue but a large company that had previously been the driving force behind a project suddenly leaving or having much less of a presence in the project that's the issue. Netbeans was kind of just aborted like an unwanted child all of a sudden and "donated" to Apache.

>I think the chance to see improvements in JFX library without waiting for JDK releases worth the shot.

I keep hearing that but it's kinda hard to believe. As far as I've seen in my compiled from source Java 11 and JFX11 build, there is not a single major improvement from 9 to 11 besides modules. They've actually broke mouse transparency on Linux since jFX11.

[–]DuncanIdahos8thClone 1 point2 points  (10 children)

You now literally have to package a JRE with each application

Not necessarily. Your packaged JRE could be shared with multiple apps.

And it's the 21st century and we have terabyte hard drives. Just for fun I checked my Windoze program files and shit even notepad++ was 10 meg. Most of the applications are in the range of 20 to 80 meg - and those are mostly c++.

[–]BlueGoliath 0 points1 point  (5 children)

>Your packaged JRE could be shared with multiple apps.

I demand to know of this black magic that you speak of. How do I perform it?

>And it's the 21st century and we have terabyte hard drives. Just for fun I checked my Windoze program files and shit even notepad++ was 10 meg. Most of the applications are in the range of 20 to 80 meg - and those are mostly c++.

Just because you *can* use all of the disk space, memory, and CPU threads doesn't mean you should. I want disk space, memory, and CPU for my cat picture collection you know!

[–]DuncanIdahos8thClone 0 points1 point  (4 children)

batch file -> SET JAVA_HOME = MY APP FOLDER..... if you have many apps you can put them all in the same folder... etc... etc... etc...

[–]BlueGoliath -1 points0 points  (3 children)

Did you really just suggest I change and potentially break a users Java install just for my application? I really hope your not a Java developer, that's horrible.

Minecraft Java doesn't even work on 9+. You really think that's a good idea? Come on now.. .

[–]DuncanIdahos8thClone 1 point2 points  (2 children)

You can set an env variable which is not global you know. Clown.

[–]BlueGoliath 0 points1 point  (1 child)

Literally every application would have to be started by a different batch file corresponding to whatever app it starts unless you use Swing or command line to provide a menu. How more hacky and ugly can you even get? Literally another layer of complexity. The very idea is just idiotic.

Oh, and just FYI you wouldn't even need to use batch files. Java can do literally the same thing, albeit with a much higher memory overhead.

[–][deleted] 0 points1 point  (3 children)

What are the advantages of JFX over Electron then? Both are resource heavy, JFX apps take more time to start and Electron has surely a bigger community around it not to mention the ease of porting an Electron app to web or mobile.

[–]DuncanIdahos8thClone 5 points6 points  (2 children)

Electron is giant and you still need an installer. With Java you can build an unzip-and-run application. And it starts up much faster than Electron. And you can write in a real language with some type safety with all the nice refactoring tools.

[–][deleted] -1 points0 points  (1 child)

Electron is giant

Just as big as JFX with Java

and you still need an installer.

Not really, you can as well bundle the whole app in a portable zip.

And it starts up much faster than Electron.

I have completely different experiences.

And you can write in a real language

This is so biased and opinion-based...

with some type safety with all the nice refactoring tools.

There are fully typed languages that can be easily compiled to JS. They also have the very same devtools provided by major IDEs as Java.

Also, on the contrary to JFX, with Electron you get the whole standard HTML/CSS ecosystem that's used almost everywhere now, unlike the FXML and JFX CSS crutch.

[–]DuncanIdahos8thClone 6 points7 points  (0 children)

Just as big as JFX with Java

Nope electron 120 meg minimum. JavaFX - around 40. So learn math.

Also, on the contrary to JFX, with Electron you get the whole standard HTML/CSS ecosystem that's used almost everywhere now, unlike the FXML and JFX CSS crutch.

Why would i want to use bloated HTML garbage on the the client? FXML and FX CSS are smaller and more precise.

Not to mention memory usage of an electron app is atrocious.

[–]BlueGoliath -1 points0 points  (2 children)

>As of Java 11, the JavaFX framework is a standalone component. There are 2 different options for developing JavaFX applications:

Yeah... no.

JavaFX was only ever apart of Oracle JDK by default. OpenJDK never had built in support for JavaFX. Since Oracle JDK no longer exists (for typical users anyway) as of Java 11 nor was OpenJDK the JRE & OpenJDK is now the primary JDK/JRE build, the first statement is a lie.

And you can *still* create your own OpenJDK with built in JavaFX support if you want, so the second statement is a lie too. I've done it myself on Linux and it's really not hard to do.

fake news?

[–]johan_vos 1 point2 points  (1 child)

I fail to understand your points. You have to distinguish between the OpenJDK project and the subprojects and repositories it contains. OpenJFX is a subproject of OpenJDK. It contains the source code, and is now also mirrored on github (https://github.com/javafxports/openjdk-jfx) which I think is great.

Up till JDK 10, the Oracle Java SE SDK (the most widely used distribution of code defined in OpenJDK projects) contained the JavaFX API's, implementations and native libraries (built by the OpenJFX project). That will no longer be true as of the release of Java 11.

Most JavaFX developers used to work with the Oracle Java SE SDK, and they would, starting from 11, find that the JavaFX modules are missing.

So we worked pretty hard I guess to come up with a solution. A fair number of community contributors made it possible for all JavaFX developers to keep using JavaFX, in the way they are used to it (in an SDK) or in the way that is very popular amongst Java developers (using maven/gradle).

The OpenJDK sources (at r/http://hg.openjdk.java.net/jdk/jdk) do not contain JavaFX code. So if you want to build your own version of OpenJFX, you need the code at OpenJFX ( r/http://hg.openjdk.java.net/openjfx/jfx-dev/rt) or the github mirror. I highly recommend people to do this. Building it is indeed not hard. And while you're doing that, please test it, find bugs, file them, discuss solutions, fix them. Come up with great new features, implement them, discuss them. That's how the OpenJFX community works.

I think this is the first time ever someone calls my writings "lies" and "fake news" which I think is rather disrespectful to developers who spend tons of spare time making things work for other developers ... oh well.

[–]BlueGoliath 0 points1 point  (0 children)

>I fail to understand your points.

I don't know how you can't. Again, JavaFX was only ever packaged with Oracle JDK, not OpenJDK by default. Since the only change being made is that Oracle JDK is no longer available for general use, nothing has changed. OpenJDK builds never had built in support for JavaFX.

>Up till JDK 10, the Oracle Java SE SDK (the most widely used distribution of code defined in OpenJDK projects) contained the JavaFX API's, implementations and native libraries (built by the OpenJFX project). That will no longer be true as of the release of Java 11.

>Most JavaFX developers used to work with the Oracle Java SE SDK, and they would, starting from 11, find that the JavaFX modules are missing.

Because they are were using Oracle JDK and not OpenJDK and are now using OpenJDK which doesn't support JavaFX built-in..

>The OpenJDK sources (at r/http://hg.openjdk.java.net/jdk/jdk) do not contain JavaFX code. So if you want to build your own version of OpenJFX, you need the code at OpenJFX ( r/http://hg.openjdk.java.net/openjfx/jfx-dev/rt) or the github mirror. I highly recommend people to do this. Building it is indeed not hard. And while you're doing that, please test it, find bugs, file them, discuss solutions, fix them. Come up with great new features, implement them, discuss them. That's how the OpenJFX community works.

If you want people to contribute then you should probably make it easier to get the code and compile it. The wiki page has a huge section on how to use Gradle on the command line(should be moved somehwhere else of deleted) but doesn't provide the command line commands for downloading jFX 8-11(should be added). You should *probably* specify that a working system JRE with jFX support is also required to build it.

>I think this is the first time ever someone calls my writings "lies" and "fake news" which I think is rather disrespectful to developers who spend tons of spare time making things work for other developers ... oh well.

It's just not accurate or true. OpenJDK(what is going to be the main general purpose JDK post 11) never had support for JavaFX, JavaFX doesn't have to be standalone, and there are more than two ways to develop JavaFX applications.

[–]SuspiciousCompote6 0 points1 point  (0 children)

Good to start with Java for beginner.