News for hackers. Stuff that matters.
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by mixologic on Tuesday October 03, 2017 @11:33AM (#15393080)
"you can distribute it to any user on any OS and it will just work."

I had to check the date on this article to see if it was from 2007 or something. Under no circumstances does java "just work", its an insane mess of java shipped with the os, being updated, and people not updating due to oracle trying to force feed crapware as part of their installers/updaters. I, for one, do not live in a world that resembles anything like java jars "just working".

Re:Say no to Electron: use JavaFX to write a fast, responsiv... by mike_hearn on Tuesday October 03, 2017 @12:03PM (#15393366)
It does just work, at least compared to web apps. I have experience of both web dev and distributing a somewhat complex JavaFX app to consumers. I bundled the JRE with my app so the users did not need to have Java installed.

The leaks in the operating system abstraction Java gives you are really quite small. I wrote my entire app on macOS and tested on Linux/Windows only right at the end - after about 8 months of full time dev work I spent about a day addressing platform specific issues. That's pretty good.

Now compare that to the mess that web browsers were and still are. It's better than it once was, but you're going to have to check every single feature of HTML5 you use to figure out which browsers implement it, which don't, which use vendor prefixes still, which only half implement it, which don't but can be shimmed using big blobs of JavaScript and so on. The web absolutely doesn't "just work": you will spend more far time working around browser specific issues than you will spend dealing with OS specific issues in Java.

Re:Say no to Electron: use JavaFX to write a fast, responsiv... by ballenf on Tuesday October 03, 2017 @12:10PM (#15393449)
> you're going to have to check every single feature of HTML5 you use ... you will spend more far time working around browser specific issues than you will spend dealing with OS specific issues in Java.

I'm confused at this comparison in terms of Electron. Do you have to worry about any of that when doing an Electron app? Or were you making a comparison between JavaFX and web dev?

Re:Say no to Electron: use JavaFX to write a fast, responsiv... by mike_hearn on Wednesday October 04, 2017 @05:12PM (#15404732)
You're right that with Electron that's not an issue as you control the browser. I was comparing the equivalent issue in web dev to the "write once run anywhere" issue in Java. If you pick the users operating system e.g. only support Windows then of course, there are no cross platform issues with Java either
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by kakwa_ on Tuesday October 03, 2017 @03:09PM (#15395133)
> I bundled the JRE with my app so the users did not need to have Java installed.

Side note here: do you track security vulnerabilities of the shipped JRE and provide updates when it happens?

Too often, I've seen java applications shipping obsolete and vulnerable JRE. And in some cases, I've seen not consistent versions across a product line.

Also wasn't there some unknowns about the right to redistribute the Oracle JRE?

Re:Say no to Electron: use JavaFX to write a fast, responsiv... by mike_hearn on Wednesday October 04, 2017 @05:13PM (#15404740)
I do track those. I didn't need to update my app at any point for them because most vulnerabilities in the JRE are to do with sandbox escapes and my app did not run potentially malicious code.
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by mjparme on Wednesday October 04, 2017 @11:29AM (#15401162)
> Also wasn't there some unknowns about the right to redistribute the Oracle JRE?

Nope, Oracle clearly says you can in their FAQ:

https://java.com/en/download/faq/distribution.xml

Re:Say no to Electron: use JavaFX to write a fast, responsiv... by wieghant on Tuesday October 03, 2017 @02:01PM (#15394530)
> It's better than it once was, but you're going to have to check every single feature of HTML5 you use to figure out which browsers implement it

There's tools for that and i'm pretty sure just writing plain html and css or some compile-to-js would have shaved off significant time from that 8 month full dev time.

Re:Say no to Electron: use JavaFX to write a fast, responsiv... by mike_hearn on Wednesday October 04, 2017 @05:15PM (#15404764)
It wouldn't have been possible to do as a webapp at all, as the app in question was a peer to peer app that spoke a fairly complex network protocol that doesn't support WebSockets (Bitcoin). But even if that issue hadn't existed, the development time went mostly on logic and p2p/networking issues. HTML wouldn't have helped and JavaFX supports a dialect of CSS2 anyway.
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by billyjobob on Tuesday October 03, 2017 @11:56AM (#15393294)
Javafx includes a packager tool which creates a native application with the runtime bundled inside. There is nothing to install.
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by ljoshua on Tuesday October 03, 2017 @11:59AM (#15393331)
Once the runtime is bundled in, what does the size of the standalone application come in at? Curious if it is close that of a bare Electron app (around 50-90 MB, depending on the platform).
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by gw on Tuesday October 03, 2017 @12:06PM (#15393395)
In my project, the jar file itself is 20MB, and the resulting files generated by javapackager are: 55MB (.exe), 90MB (.dmg), and 67MB (.deb), all of which include the jar file inside them. These are not the total file size after installation, though.
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by mjparme on Wednesday October 04, 2017 @11:36AM (#15401218)
Was this using the "javapackager" tool? This seems to have been introduced in Java 1.7 as far as I can tell.
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by gw on Wednesday October 04, 2017 @01:41PM (#15402360)
Yes, I mentioned javapackager in the comment.
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by mjparme on Wednesday October 04, 2017 @03:16PM (#15403552)
Hmm, indeed it does, but I could have swore that the first time I read the comment it didn't. I guess I forgot how to read earlier :-)
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by mike_hearn on Tuesday October 03, 2017 @12:11PM (#15393462)
Yes in Java 8 it's comparable. In 9 it should be smaller due to some dead code elimination on module boundaries, but 9 just came out so it's a bit early for people to have experience with it yet.

Note that even in 8 you can do a DCE pass over the code and erase files you know you won't need from the JRE image by hand. I did this and shrank the size of the download by about half. The JavaScript world calls this "tree shaking", you can use ProGuard to do it in Java but it's a bit fiddly to set up.

Re:Say no to Electron: use JavaFX to write a fast, responsiv... by billyjobob on Tuesday October 03, 2017 @12:04PM (#15393381)
For Java 8 it is about 200mb. Java 9 should be smaller because it should only bundle the parts the app actually used.
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by AlphaSite on Tuesday October 03, 2017 @12:15PM (#15393503)
Isn’t that the JDK, the jre is smaller from what I remember.
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by maxxxxx on Tuesday October 03, 2017 @12:02PM (#15393357)
.NET could use that.
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by revelation on Tuesday October 03, 2017 @12:26PM (#15393599)
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by maxxxxx on Tuesday October 03, 2017 @12:48PM (#15393807)
.NET Core unfortunately doesn't support WPF . I think UWP isn't supported either.
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by pjmlp on Tuesday October 03, 2017 @02:58PM (#15395050)
The official native UI for .NET Core being discussed at .NET Conf 2017 was Xamarin.Forms, as they are adding macOS, Linux and WPF support as well.
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by Hupriene on Tuesday October 03, 2017 @12:00PM (#15393333)
Generally java desktop software is wrapped together with a bundled jre and behaves like an executable without external dependencies. There are a bunch of ways to do this. For example: https://github.com/libgdx/packr
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by JohnTHaller on Tuesday October 03, 2017 @11:39AM (#15393122)
Correct me if I'm wrong, but I don't think the Java updaters on Windows do bundleware anymore. I know nearly all the free Windows antivirus updaters automatically install Chrome and set it as your default browser unless you pay close attention still.
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by tajen on Tuesday October 03, 2017 @11:45AM (#15393192)
The damage is done. Thank you Oracle.
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by topspin on Tuesday October 03, 2017 @11:59AM (#15393321)
That "bundleware" (as JohnTHaller calls it) stuff was going on before Oracle. I recall being disappointed that Oracle hadn't stopped it several versions into the Oracle rebranding.

Sun did that damage.

Re:Say no to Electron: use JavaFX to write a fast, responsiv... by dawnerd on Tuesday October 03, 2017 @11:45AM (#15393196)
Yeah I haven’t even had java installed in years. Only have a single app that uses it but it’s tucked away in a docker container. It’s basically flash to be, no longer a need.
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by wyattjoh on Tuesday October 03, 2017 @11:53AM (#15393275)
I have an old release of Photoshop, didn't even install it because it demanded such an old version of Java.
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by pc86 on Tuesday October 03, 2017 @11:36AM (#15393098)
Yeah, try getting any Java program to work on a Chrome box.
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by Arkanosis on Tuesday October 03, 2017 @11:40AM (#15393133)
… especially if there's a dependency on JavaFX which is not available by default with every “Java” out there (eg. OpenJDK on Ubuntu).
Re:Say no to Electron: use JavaFX to write a fast, responsiv... by jgneff on Tuesday October 10, 2017 @11:27AM (#15442594)
I reported a bug on Launchpad last week for the missing JavaFX support in the Ubuntu OpenJDK package.

For details, see "JavaFX support is in upstream OpenJDK 9 but missing in Ubuntu OpenJDK 9" (https://bugs.launchpad.net/ubuntu/+source/openjdk-9/+bug/172...).

Re:Say no to Electron: use JavaFX to write a fast, responsiv... by sydd on Tuesday October 03, 2017 @12:44PM (#15393776)
this is why you package the whole JVM with it. This leads to a native executable without any dependencies (e.g. IntelliJ products)