Live data from Hacker News

The decline and fall of Java on the desktop

jdeploy.substack.com

211–220 of 362 posts

Re: The decline and fall of Java on the desktop

#211
It's interesting to note that probably the best selling Java application for desktop is owned and maintained by Microsoft: Minecraft. It's a testament to the technology that they still after all these years have not managed to make a definitive non-Java version that replaces the Java edition outright.

Re: The decline and fall of Java on the desktop

#212

Nice to see that Java works pretty well for indie games these days -it's a more pleasant language & ecosystem to work with than C++, and you don't need to deal with Unity's bullshit. Slay The Spire and Mindustry were written in it.

I heard Slay the Spire was also ported to Nintendo Switch. Any idea how they did it?

Re: The decline and fall of Java on the desktop

#213

Earlier quoted context omitted.

"Swing suffered from two central weaknesses: the tutorials provided by Oracle were... often insufficient. And you could pick up some bad habits by following them. And then there were the UI builders where anybody could draw up something mediocre." Agreed. Also, the IDEs would typically give you too much rope - enough for a novice to hang himself. When you create a new project with Xcode, you get a default project wit…

Oh, yes, the details are critical. Once inherited a 2D graphic editor... so slow it was totally useless. After tinkering a bit I noticed coordinates were sometimes 'long', sometimes 'Long'... gazillions of automatic boxing and unboxing operations resulted in a severe performance penalty. But the original developer didn't figure this out, tried to fix the problem by adding some multithreading on top... and of course b…

I played with Swing a bit and really liked the control it provides. Is there any book that you recommend other than Filthy Rich Clients by Chet Haase to develop complex Swing application or to pick up good habits?

Is swing still developed and is there any reason I should pick JavaFX over Swing?

Re: The decline and fall of Java on the desktop

#214
Code signing killed Web Start for anything but big $$$ projects. And asking people to download an application and run it with full privileges is a huge barrier to entry.

Contrast with the web deployment model:

* Deploy with a free SSL certificate

* Click Once, Run Anywhere (CORA)

Luckily for Java fans, you can make great Java apps for the modern web. Tools like TeaVM (and its Flavour toolkit for SPAs) make it possible. Code in Java, bind to real HTML templates, compose your app out of reusable HTML components, style with CSS. All the benefits of the modern web, with a single strongly-typed language top-to-bottom.

* TeaVM: https://teavm.org

* Real 5-letter word app made with TeaVM/Flavour: https://frequal.com/wordii/

* Migration Guide from Swing to TeaVM: https://frequal.com/TeaVM/migration/MigratingFromSwingToTeaV...

* Java Magazine article on TeaVM: https://blogs.oracle.com/javamagazine/post/java-in-the-brows...

Re: The decline and fall of Java on the desktop

#215

Earlier quoted context omitted.

That's not the fault of the language, though I'd say maybe Kotlin is a considerably better choice nowadays. If by blockly you mean the visual interface, what you said is going to be true for any language. If by blockly you mean javascript, maybe, but honestly if it's an exercise to build foundations (and not just for personal gratification), javascript (or python) isn't much easier for kids than Java, because it has…

> And if there's any fault in the language chosen for AP computer science, the blame should go to the designer of the curriculum. Java was recommended for AP CS 22 years ago. At this point I lay less fault at their feet and I'm more interested in why it's still there at long last. > If by blockly you mean the visual interface, what you said is going to be true for any language. My research isn't published yet but I'v…

For just a lesson of writing code to achieve a specific functionality, you can streamline the process a lot by just starting with a template and let students fill in the gaps. So you don't necessarily make them spend time on "public static final void main", but setup a project in which students can type code, build and see results. To teach them to write robotics code, you can create a Robot class for them to play with, and then gradually move into the more lower level details. That's certainly how it's done in many college courses too, where templates are setup and students are expected to incrementally add things to address the specific concepts they need to learn, but without worrying too much about details that don't relate to the fundamental concepts. Sure it requires some investment on your side, but your students benefit from being able to start picking up a more marketable skill. This also helps them see your code organization and existing implementation, which they can mimic if they want to extend beyond what's taught.

Matlab is really not a good example imo because if you start wanting to do a bit more, even if it's just to organize the code in better logical blocks, it bad design and lack of OOP gets in the way and makes further progress slower especially for the more talented students.

And finally, while I agree Java might not be the most optimal to teach at the AP level, what you said isn't worth bashing the language for in general terms. It's still sqaurely the AP curriculum's fault that it chooses Java and at the same time requires it to be taught in a way that's not fun or efficient, and not have updated it in 2 decades (while Java had many iterations)

Re: The decline and fall of Java on the desktop

#216

Successfully using JavaFX (or OpenJFX as it is now called) in a mission-critical cross-platform app with 50k+ installs. It’s not that bad really. Package size and RAM usage is a bit of an issue, as we bundle it with a jlink’ed (stripped down to what is needed, thanks to Java 9 modules) JDK. Other options like Electron or native Windows/macOS wrappers around a shared core written in C++ were discussed but ultimately d…

The unbundling of JavaFx from JDK has made using JavaFx a bit of a chore in a new project. I think it was a bad move, and has made the future of JavaFx uncertain.

Question is can JavaFx be recommended for a new project, given the uncertainty of its future and lack of popularity.

Re: The decline and fall of Java on the desktop

#217
Cross platform used to mean, windows, mac, and linux. These days it is web, ios, android, windows, mac, and linux. In that order. And that's before you consider TVs, cars, and other equipment where apps are also relevant.

These days web is the new cross platform technology. It works everywhere. And mobile is where people focus for native apps. Windows is an afterthought at best. Mac even more. And Linux oddly is now a main source of open source applications that also work on windows and mac. But it's not a big market.

Unless you consider Android a linux distribution. In that case it's absolutely huge. And Java/Kotlin are the languages of choice on that platform. But they are compiled to native ahead of time so don't require a JVM.

Otherwise, Applet support for browsers died a long time ago so that blocked Java from being useful on the web. The JVM as distributed by Oracle (and other openjdk packagers) only really covers the traditional three desktop platforms. And it's not really native there and kind of heavy weight. That limits the appeal. Java is not really that cross platform anymore. Sun failed to anticipate and survive the move to smartphones. Up until then J2ME was a thing. These days almost no phone comes with Java support. That's the real reason Java usage on the desktop declined. It did not cover new platforms from about 2007 onwards.

Despite this there's a new JVM framework on the block: compose desktop. It uses skia (like flutter) and there's a mobile variant supported by Google called jetpack compose. And a web variant called compose web. IOS support is missing. But that looks like it might be addressed at some point.

Re: The decline and fall of Java on the desktop

#218

Earlier quoted context omitted.

Oh, yes, the details are critical. Once inherited a 2D graphic editor... so slow it was totally useless. After tinkering a bit I noticed coordinates were sometimes 'long', sometimes 'Long'... gazillions of automatic boxing and unboxing operations resulted in a severe performance penalty. But the original developer didn't figure this out, tried to fix the problem by adding some multithreading on top... and of course b…

I played with Swing a bit and really liked the control it provides. Is there any book that you recommend other than Filthy Rich Clients by Chet Haase to develop complex Swing application or to pick up good habits? Is swing still developed and is there any reason I should pick JavaFX over Swing?

Funny you mention that. I co-wrote Swing Hacks for O’Reilly in 2005 and I still get about 50$ A year in royalties. So someone must still be writing Swing Apps.

Re: The decline and fall of Java on the desktop

#219

My desktop text editor[1] is written using JavaFX and leans on Warp Packer[2] to create installer-free, multi-platform executable binaries (without jlink). A user contributed a new dark theme[3], which blends nicely with the desktop. The JavaFX-based WebView (an HTML rendering component) is lauded, but has no direct API to control the scroll position and is itself a memory hog. Scrolling must be handled through JavaS…

Wow, someone is still using Flying Saucer? That brings back such memories. I'm glad to know it helped some people.

Re: The decline and fall of Java on the desktop

#220
As a member of the Swing/JavaFX/Netbeans teams during the 2005-2010 period (I left the day before Oracle took over), I can tell you that this story is broadly correct, but with many missing subtleties. At the time we thought of Silverlight and Flash and Adobe Air as our mortal enemies. We were all wrong. After AJAX and HTML Canvas the web essentially killed desktop app development. All of those internal corporate apps (which were 95% of the desktop Java apps written) migrated to the web. We certainly all made mistakes and could have done some things differently (I begged to write the Applet plugin from scratch), but in the end none of those changes would have mattered. The future of desktop was the web.
Post reply on HN