Live data from Hacker News

The decline and fall of Java on the desktop

jdeploy.substack.com

181–190 of 362 posts

Re: The decline and fall of Java on the desktop

#181

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…

JavaFX was pretty good when I evaluated it around the time of JDK7/8. At the time I was also looking into other Rich Client Platforms: Adobe AIR, MS Silverlight, Eclipse RCP, and (sort-of-not really) Netbeans. Any of them could techically be used but JavaFX was the most open and likely to be supported at that time. Used it for come proof-of-concepts and it worked fine, though it took some re-orientation for some devs.

Re: The decline and fall of Java on the desktop

#182
post #4

Java Swing still lets you make native-looking-and-feeling apps (with some care). I don't know of any new GUI frameworks that let you do the same. I consider this a killer-feature of the framework. It's also very fast, backed by OpenGL and DirectX. It also ships with source code and isn't declarative, so it's trivial to step into as a means to debug why your code isn't working.

Interesting, I'm not aware of any Java app that truly feels or looks native. I guess that there is definitely some selection biais, but do you have any examples of native-like Java Swing apps?

SWT apps look native last time I used them.

Re: The decline and fall of Java on the desktop

#183

Earlier quoted context omitted.

My understanding is that most of security defects in the JRE were related to the browser integration. The core Java sandbox was secure.

Most of the high profile security issues have been either sandbox escapes or serialization issues. The sandbox escapes were made worse by having applets in the browser. Now that applets are not a consideration any more the sandbox (SecurityManager) isn't used very much anymore and the Java devs are looking at deprecating and removing it, so most of the sandboxing features will go away.

I remember when Java applets could prompt the user to accept "all or nothing" permissions and fine grained permissions wasn't supported.

Re: The decline and fall of Java on the desktop

#184
Yeah, webstart was an unusable shit-show.

I remember writing a first SWT app (with embedded JRE) ~2004 and it looked nice and worked fast enough.

I think if Sun/Oracle didn't legally ban JRE trimming, added offical Swing browser widget and added a free cross-platform good-looking and developer/user-friendly installer - the story would've been different.

Re: The decline and fall of Java on the desktop

#185
post #54

Earlier quoted context omitted.

Basically, every growth figure of the language shows otherwise. Oracle is ain’t saints, but the amount of needless bashing it gets here is astonishing. Regardless of what its other branches are doing, Oracle managed to do one of the smoothest language takeovers where the (stellar) core team is virtually unchanged, the language became completely open sourced and it underwent tremendous changes which resulted in huge g…

> but the amount of needless bashing it gets here is astonishing I don't think it's needless. I'll bash Java as long as it's the language for AP computer science. Imagine a budding young programmer, bright eyed and bushy tailed, eager to get into computer science. They get to class and greet the teacher "Welcome class, let's learn about Java. There's a wide world of computers out there, but your perception of computi…

Agree, but recently Minecraft mod (written in Java) is a popular way how to learn code with joy.

Re: The decline and fall of Java on the desktop

#186

This article seems quite off. First, it conflates browser and desktop. Yes, applets died an early and deserved death. That is different from what happened with desktop apps. A univeral GUI (e.g. Swing) was wrong-headed. I don't actually know what happened after people moved away from Swing. But even in the time range TFA discusses, Intellij IDEA, an IDE written in Java, was a success. It has always been multi-platfor…

The article glosses over a couple of points I recall from living through the same period:

- JBuilder was performant (and as I recall, for GUI development, awesome). Not sure if it was Swing-based, but it was a counterpoint to the idea that you couldn't build performant Java GUI apps.

- Applets were stifled by Microsoft refusing to include a contemporary Java runtime in IE, which was still dominant around 2000. My recollection is a bit vague now, but I seem to recall that Java applets in IE were stuck on a 1.0 JVM when Java 1.2 was contemporary.

It's worth noting that I was developing on Linux and Windows. The author's experience would have been coloured by his use of the Mac platform. Up until quite recently, Macs were stuck on Java 6 while the rest of us were using Java 8, at least. I can't help but wonder if Apple considered Java to be a second class citizen.

Re: The decline and fall of Java on the desktop

#187
post #67
post #29

On the other hand Minecraft is the best-selling PC video game of all time and it was originally written in Java and the Java client is the definitive experience of the game.

not really a desktop app though, is it? And Minecraft is also a notable outlier. Outside of mobile, there are very few games written in java on PC or consoles.

That's right let's not forget about the famous Ruby and Javascript desktop games that have outsold Minecraft...

Re: The decline and fall of Java on the desktop

#188

Earlier quoted context omitted.

> but the amount of needless bashing it gets here is astonishing I don't think it's needless. I'll bash Java as long as it's the language for AP computer science. Imagine a budding young programmer, bright eyed and bushy tailed, eager to get into computer science. They get to class and greet the teacher "Welcome class, let's learn about Java. There's a wide world of computers out there, but your perception of computi…

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've found this is not necessarily true. This is a product of taking a thing not built for kids but rather professional programmers, and then forcing kids to use it. The problem with Java is that it's the kind of system where you need to know everything about it to use it all. Going from 0 to "hello world" requires over a dozen distinct Java concepts explained.

  public class MyFirstJavaProgram {
    public static void main(String []args) {
      System.out.println("Hello World");
    }
  }
We've got access modifiers, classes, scopes, lifetimes, variable types, void variables, methods and in particular the main method, String types, arrays of strings, input arguments to main method, the System class, output streams, function calls, string literals, and to top it all off a good old fashioned statement terminator as the cherry on top of that feature sundae. The great irony is that the AP Computer Science Ad Hoc Committee call this behemoth "simple".

That's lesson one, and all it gets you is "Hello World". Most instructors handle this as "Ignore all the things you're writing down, we'll talk about them over the course of the next 3 months." Because that's how long it really takes.

This leaves students in a perpetual state of confusion, where they feel like they never really understand what's going on. Everything is a mysterious incantation and nothing really makes sense. Do wrong thing and it tells you it's wrong, but you won't understand why.

Students spend a lot of time memorizing "static void pub main()"... or was it public void static main? Or static public void class? I dunno, let's consult the spellbook. Because on day one their instructor said "ignore all of that, it's too complicated for you." Well students do ignore all of that, and it teaches exactly the wrong lesson -- they don't learn Java or programming, they learn that programming is hard and not for them yet. It's beyond them, but they're going to do it, and maybe one day they will understand, but not today. Today just write the code and run it.

At this point, most students give up. And I will say that yes, this is Java's fault. Not all programming languages require you to learn a dozen very deep and nuanced concepts to get to "Hello World".

Here's the ideal Hello World program for students and honestly for me too:

  "Hello World"
That's it. That's the ideal. You get that in languages like Matlab, and I've had great success teaching robotics using Matlab. With Matlab, students are writing real robot programs within a few hours, whereas with Java students are still raising their hand asking "Wait, so what's the difference between an object and a class? What's a method versus a function? What's static mean? What does void mean? What does []args mean?"

It's my contention that the design of the Java language frequently turns away all but the most technically minded students at precisely the time when they are the most impressionable when it comes to their perceptions of computing, and we're all worse off for it.

Re: The decline and fall of Java on the desktop

#189

I just wish it'd go away entirely. I'm not a dev. But an admin. And I despise supporting or troubleshooting Java applications. Unfortunately that's my life these days. From an admin perspective, python, php, hell.. Even ruby. All fine. But Java is a nightmare.

Working on a successful Java shop with thousands of deployments per month. Curious about what's so hard about Java.

Curious why you dont recognize the obvious. The different runtimes each have their own behavioral/configuration quirks, library incompatibilities, and workarounds. This leaves stack traces as being less than helpful without full context.

Re: The decline and fall of Java on the desktop

#190

Earlier quoted context omitted.

I am not sure that was the problem, The way I recall it: The apps were typically pretty ugly and Windows had a near monopoly at the time. If either of those were not true, it might have fared better.

Swing default appearance may look alien on windows, but I remember a demonstration from a friend of mine where he turned it to native appearance with a few clicks. You can see some successful java desktop apps with native UI, one I remember is utorrent. Also, windows users are very used, specially at the time, to inconsistent appearance. So, I don't think default appearance on windows had anything to do with java's d…

uTorrent is definitely NOT Java --- the binary itself is a few orders of magnitude smaller than a JVM! You might be thinking of Azureus (since renamed Vuze)?
Post reply on HN