Remix.run Logo
panny 3 days ago

And a thank you to Oracle for being a good steward of the language.

stickfigure 3 days ago | parent | next [-]

I really don't want to upvote this sentiment but I must anyway.

The fact is, despite Oracle being a menace to the tech industry, Java under their watch is thriving. Which is weird, because I don't know anyone who gives them money for Java. I'm genuinely curious who these companies are and what their incentives are!

didip 3 days ago | parent | next [-]

For real. When Sun got bought, I thought to myself: “At least they would also destroy Java…”.

But nooo, Java thrives and flourish under Oracle protection.

api 3 days ago | parent | next [-]

Java gets more hate than it deserves. "There are languages everyone complains about and languages nobody uses."

Most of the hate comes from the overly complicated "enterprise design patterns" crap that took over the ecosystem in the late 90s into the 2000s, not the language itself. It's quite possible to write clean, clear, appropriately complex, well performing Java code.

On the plus side, of all the languages I've used Java is one of the absolute best when it comes to long term maintainability of code. This is why it's used so heavily in large enterprises with long-lived business critical code bases. Being the "COBOL of the 1990s/2000s" is not an insult, and as a language it is far superior to COBOL in every way. It's not a bad language to program in at all, while COBOL will make you hate your life.

It's also a safe language unless you break out of the JVM with JNI. It's the first safe language to get huge deployment if you don't count scripting languages. Safe doesn't mean you can't have security bugs of course, it just means you're not likely to have certain kinds of security bugs and stability problems like memory errors.

The JVM is really a fantastic piece of engineering and IMHO represents a whole direction in computing I feel sad that we didn't take. We opted to stay close to the metal with all the security, portability, code reuse, and other headaches that entails, instead of going into managed execution environments that make all kinds of compatibility and reuse and portability problems mostly go away.

The biggest current knock against Java I see is JNI, which unlike the core language is absolutely horrible. The second biggest knock is that the JVM is still kind of a memory pig. CPU performance is great, sometimes converging with C or Rust performance depending on work load, but it still hogs RAM.

pron 2 days ago | parent | next [-]

> The biggest current knock against Java I see is JNI

Then you'd be happy to learn that it's been superseded by FFM: https://openjdk.org/jeps/454 (not in all situations, but in almost all).

> The second biggest knock is that the JVM is still kind of a memory pig

I would strongly recommend watching this keynote from this year's ISMM (International Symposium on Memory Management) on this very subject: https://www.youtube.com/watch?v=mLNFVNXbw7I

The long and short of it is that (and I'm oversimplifying the talk, of course) if you use less than 1GB of RAM per CPU core, then you're likely trading off CPU for RAM in a way that's detrimental, i.e. you're wasting a valuable resource (CPU) to save a resource (RAM) that you can't put to good use (because the amount of work you can do on a machine is determined by the first of these resources to be exhausted, so you should use them in the ratio they're provided by the hardware). Refcounting collectors and even manual memory management (unless you're using arenas almost exclusively) optimise for memory footprint at the expense of CPU. Put another way, the JVM takes advantage of the more plentiful RAM to save on the more costly CPU.

creata 2 days ago | parent | next [-]

Sorry if this is a stupid question, but does this argument continue to make sense for desktop applications, which don't typically use much CPU unless they're currently focused, but do use the same amount of RAM regardless of whether they're focused?

pron 2 days ago | parent [-]

When it comes to desktop apps much of the memory is paged out to disk anyway when a program is not focused.

vladgur 2 days ago | parent | prev [-]

When is FFM going to be production ready?

spreiti 2 days ago | parent [-]

Since JDK 22 https://openjdk.org/jeps/454

hashmash 3 days ago | parent | prev | next [-]

> The biggest current knock against Java I see is JNI, which unlike the core language is absolutely horrible.

JNI was only ever designed to be good enough, and it is. The new FFM API aims to replace JNI in most cases, but it's designed to be "perfect". As a result, the new API took many years to develop, but JNI was quick to develop.

It would be nice to have the FFM API much sooner, but alternatives like JNR and JNA have been around for a long time. There wasn't a rush to develop a JNI replacement.

3 days ago | parent | prev | next [-]
[deleted]
ok123456 3 days ago | parent | prev | next [-]

The language has evolved a lot since the "enterprise" Java days. Much of the unnecessary ceremony was relaxed, and it became less religiously adherent to the idea that it was simply a compiled, statically typed successor to Smalltalk.

DaiPlusPlus 2 days ago | parent [-]

...but the elders still decree Java will never be granted ergonomics QoL improvements like getters/setters because...? At this point it feels like their pride is at stake.

stickfigure 2 days ago | parent | next [-]

I don't understand what you're saying. Java records don't need getters/setters. If you want that interface there's lombok.

ok123456 2 days ago | parent [-]

Records is a very new addition. lombok is writing bytecode directly to facilitate that.

peterashford 2 days ago | parent | prev [-]

wut? Java has always had getters and setters

peterashford a day ago | parent [-]

Downvoted for stating an objective fact?

DaiPlusPlus a day ago | parent [-]

(I didn’t downvote you)

In my post, I’m referring to Java’s refusal to adopt “properties” (i.e. methods invoked using the same syntax used for fields) like VB, C#, JavaScript, Swift, et cetera.

estimator7292 3 days ago | parent | prev | next [-]

I hate Java because debugging java code is worse than debugging assembly

krior 3 days ago | parent | next [-]

As a Intellij-user I am more than a little confused. What are features missing from Java's debugging story?

eklavya 3 days ago | parent | next [-]

I have mostly heard these complaints from people who haven't used a java ide and/or do not know that jvms allow waiting for a debugger before starting execution (helps with all sorts of spring or whatever errors and boilerplate).

That said, there is a shitload of "enterprise" fuckery in Java, but those Devs would have made a mess of any codebase anyway.

vips7L 3 days ago | parent | prev [-]

Yeah this comment is wild to me. Java’s debugging is so good I can debug a remote server from my local machine.

Tostino 2 days ago | parent [-]

Something I've had to do a handful of times against production systems when we absolutely couldn't reproduce an issue locally. Such a great debug ecosystem.

spreiti 3 days ago | parent | prev | next [-]

How much experience do you have working in Java? This statement really surprises me because Java has some of the best in class tools to debug and troubleshoot issues.

peterashford 2 days ago | parent | prev | next [-]

This has to be one of the wrongest opinions I've ever seen on HN. It's mind-bendingly wrong. Java would, IMO, be the easiest programming language in the world to debug. The debugging tools are mature, consistent and extensive.

throwaway7783 2 days ago | parent | prev | next [-]

This is really a wild take. Java's debugging support is one of the best out there.

trollied 3 days ago | parent | prev | next [-]

I hate to say it, but this is because you are not a Java developer. It’s very easy to debug.

pjmlp 3 days ago | parent | prev [-]

Found out another printf debugger.

bheadmaster 3 days ago | parent | prev [-]

In my experience, the problem of Java is the lack of standardized tooling.

To build an average Java software, you have to install a specific version of JDK, download a specific build system (Ant, Maven, Gradle, Bazel), hope everything works out on the first try - and if not, debug the most-likely-XML spec file searching for invalid dependency that's printed out on the 1000-line error output...

What Java is desperately missing is something like Python's `uv`.

---

Sibling comment mentioned that debugging Java itself is also a nightmare, which reminds me of the many Spring Boot projects I've had to debug. Stack traces containing 90% of boilerplate code layers, and annotations throwing me from one corner of the codebase to another like a ragdoll...

Admittedly, that's not inherently the problem of Java, but rather the problem of Spring. However, Spring is very likely to be found in enterprise projects.

vips7L 3 days ago | parent | next [-]

I think this is really just anecdotal to your experience. Don’t you need to install a specific version of a compiler or interpreter for every language? Isn’t trying to build any complex project a pray on the first try? I’ve worked in Go codebases where it’s not simply “go build”. It’s: try go build, oops you need to use the make/justfile, oops don’t forget you need to install jq or some other random tool. Complex projects are complex.

Mawr 3 days ago | parent | next [-]

Not at all? There is an obvious difference between modern languages' (Go, Rust, Zig) build systems and the old mess (C++, Java, Python). You have one tool that does everything you need, from formatting and linting to package management and building. No need to choose between Maven or Gradle or try to string together five third party programs that barely work together.

> I’ve worked in Go codebases where it’s not simply “go build”.

A rather funny statement that says the opposite of what you intended. That you can expect most Go projects to be built with just `go build` is high praise.

vips7L 3 days ago | parent [-]

I expect most Java projects to be built with mvn package or gradle build. It doesn’t mean it’s always that simple. Simple projects can be built simply. Complex ones are never handled by 1 tool. There are plenty of examples in Rust and Go where people have to use make or just.

mleo 2 days ago | parent | next [-]

This has been one of my pet peeves on our projects; how simply can I build a project and run it. Ideally with just Java and git, can I download, build and run. Throw in some projects with native libraries, can I build with compiler tools installed but not building 5 other projects first with environment variables pointing to locations of code.

pkolaczk 3 days ago | parent | prev [-]

However, gradle build or mvn install won’t select a proper version of Java to build your code. It won’t even tell you are building with wrong version. Rust, Go, even Scala SBT will.

ivan_gammel 2 days ago | parent | next [-]

Normally you just define source and compile target and then use whatever JDK supports them. Dependency on exact version is a rare thing. Neither gradle nor Maven are independent native tools, both run on the same JVM they use, so they are not even aware of your specific OS configuration and available JDKs. But they will certainly tell you if your JDK does not support your source or compile target.

ohdeargodno 2 days ago | parent | prev [-]

> However, gradle build or mvn install won’t select a proper version of Java to build your code.

    build.gradle.kts
    java {
        toolchain {
             languageVersion = JavaLanguageVersion.of(17)
             //bonus: pick your favorite distribution with vendor = JvmVendorSpec.<X>
        }
    }

Oh yes they will.

> It won’t even tell you are building with wrong version.

Right, "Class file has wrong version" doesn't explicitly tell you it's the wrong JDK. Gradle itself runs from a JDK8, so even the install you made with your Windows XP will work fine.

If your last experience with Java was 20 years ago and you think that for some reason it hasn't kept up with modern advancement and leapfrogged most languages (how's async doing in rust? virtual threads still stuck nowhere? cool.), sure, keep telling yourself that. You could at least keep it to yourself out of politeness though, or at the very least check that what you're saying is accurate.

bheadmaster 2 days ago | parent | prev [-]

> Isn’t trying to build any complex project a pray on the first try?

I managed to build Docker Daemon - one of the most widely used and complex Go projects - from source with a simple `go build`.

I've never figured out how to build Jenkins from source.

Do you know of any widely used Java project that has a simple build process? Maybe a positive anecdote could change my mind.

ohdeargodno 2 days ago | parent [-]

[dead]

rileymichael 2 days ago | parent | prev | next [-]

> To build an average Java software, you have to install a specific version of JDK, download a specific build system (Ant, Maven, Gradle, Bazel), hope everything works out on the first try

to build a modern java project with gradle, you need _any_ jvm installed on your pc. you execute a task via the gradle wrapper (which is committed alongside the code) and it will download and invoke the pinned version of gradle, which then downloads the configured java toolchain (version, vendor, etc.) if it can't find it on your machine.

it just works.

bheadmaster 2 days ago | parent [-]

> to build a modern java project with gradle [...] it just works.

That's the thing - it "just works" if you're on a "modern" Java project, if it uses Gradle, and if it uses it properly. Most of the Java projects I've had pleasure on working profesionally were not on that standard of quality.

You may argue that it's up to developers to keep build system simple, but in that case C++ tooling also "just works" because you can build a modern C++ project that uses CMake in two commands.

Good tooling prevents the project build process from becoming an undocumented Rube Goldberg's machine.

ohdeargodno 2 days ago | parent [-]

[dead]

maksut 3 days ago | parent | prev | next [-]

I disagree with this. The tooling around JVM is great or at least good enough.

Maven is mostly smooth sailing comparing to Python's env solutions or JS ecosystem. Maven is 21 years old. A quick search says Python has/had; pip, venv, pip-tools, Pipenv, Poetry, PDM, pyenv, pipx, uv, Conda, Mamba, Pixi.

Debugging is just fine. Modern debugging tools are there. There is remote debugging, (although limited) update & continue, evaluating custom expressions etc. I don't know what they complain about. If using Clojure, it is also possible to change running application completely.

Monitoring tools are also great. It is easy to gather runtime metrics for profiling or monitoring events. There are tools like Mission Control to analyse them.

ojosilva 3 days ago | parent | prev | next [-]

Python is a front-end for C, like Perl, PHP and Ruby. Its environment configuration is a mess, specially if you need to recompile libraries with different python versions.

Java may have a long history of compatibility issues between the compiler, tooling and libraries, but it's all reasonably delimited to the Java language, so, if anything, a `nvm` equivalent such as sdkman.io should suffice.

theanonymousone 3 days ago | parent | prev | next [-]

> What Java is desperately missing is something like Python's `uv`.

JBang exist and (if I'm not mistaken) predates uv. See jbang.dev

pjmlp 3 days ago | parent | prev | next [-]

We don't need Rust written tools in Java.

Phelinofist 3 days ago | parent | prev | next [-]

I totally disagree, please don't add something like envs to Java, ever. Working with Python is a huge pain because of that. Also, mostly just a JDK that is new enough, because of the strong backwards compatibility of the Java ecosystem.

ivan_gammel 3 days ago | parent | prev [-]

Spring does some magic, but I cannot agree with you that it is hard to debug. Maybe if you don’t understand it at all, but its architecture isn’t rocket science.

jayd16 2 days ago | parent | prev [-]

The idea that Oracle is evil and that's why they're striving to increase Java market share is the funniest thing I've read today. Thank you.

exabrial 3 days ago | parent | prev [-]

I feel like that tide is changing in general. Not that two wrongs make a right, but don’t forget Microsoft once sold “Linux Licenses”, and then there’s the whole SCO vs IBM debacle. Lawyer driven revenue streams are falling out of style, unfortunately Oracle was a late bloomer. They’ve done an incredible amount of damage to their reputation.

pjmlp 3 days ago | parent [-]

Not everyone cares that much about their reputation outside FOSS circles.

Sun was aided by Oracle and IBM into the whole Java push during its early days.

Many apparently aren't aware of their roles into the whole Java history.

Oracle was the first RDMS with Java drivers, all GUI tooling rewriten into Java, JVM into the database, JSF famework, and acquisition of BEA and its JIT technology.

Also collaboration with Sun in the Network Computer thin client with its Java based OS.

parttimenerd 3 days ago | parent | prev | next [-]

And a thank you to all the other amazing companies. The work on the JEP is chiefly sponsored by SAP (with help from Datadog and Amazon).

ksec 2 days ago | parent | prev | next [-]

Thank You for giving credit where credit is due, especially on Oracle.

The pendulum is shifting on HN. We can finally give credit to Oracle and Facebook.

reactordev 3 days ago | parent | prev [-]

[flagged]

pron 3 days ago | parent | next [-]

The only thing that's paid is support, and the OpenJDK folks are Oracle employees (well, the ~90% of them who do ~95% of the work on OpenJDK). OpenJDK is an Oracle project in the same sense that Chromium is a Google project. In fact, OpenJDK (even more precisely - the OpenJDK JDK) is the name given to Oracle's implementation of the Java SE specification, but we do get contributions from other companies, such as this particular great enhancement to JFR (even external contributions also involve significant work by Oracle employees).

Anyway, if you don't want to buy a support service, either from Oracle or any of the other companies that sell it, the use of the JDK is free. There is no "enterprise" flavour of the JDK, paid features, or use restrictions as there used to be under Sun's management. Java is obviously freer now - as in beer or in speech - than it was 20 years ago.

reactordev 2 days ago | parent | next [-]

Then why is it every time the Oracle reps come around, we are audited by our use of Java, what machines they are on, how many cores, etc as additional line items to our Oracle agreements that we have to fight, every year, to get removed? They state themselves, they charge per-employee, not per core now…

While everything you say sounds true, it’s not free - it’s gunpoint, it’s a lie, and if you’re big enough Oracle will come after you for subscription fees.

RedHat does the same crap. Heaven forbid you run RHEL on RHEL in containers, you’re gonna get fleeced.

pron 2 days ago | parent | next [-]

Your company has bought support from Oracle - either for the JDK or for some other product bundle - and that's part of the terms of whatever commercial service your company bought. There are no audits and no cost for people who just download and use the JDK. Oracle doesn't collect names or contacts, you don't need to provide any when you download the JDK, and the licence expressly permits commercial use (even if you choose the non-open-source licence; the download page for the non-opensource distribution says [1]: "JDK N binaries are free to use in production and free to redistribute, at no cost"). There used to be lots of use restrictions back in the Sun days, but Oracle removed them.

[1]: https://www.oracle.com/java/technologies/downloads/

carlwgeorge 2 days ago | parent | prev [-]

> Heaven forbid you run RHEL on RHEL in containers, you’re gonna get fleeced.

You can run unlimited RHEL containers on a subscribed RHEL system. It's even set up where if you run a UBI container (a redistributable subset of RHEL content) on a subscribed RHEL system it automatically upgrades to full RHEL.

Moomoomoo309 3 days ago | parent | prev [-]

There is an enterprise flavor of the JDK. It's called GraalVM enterprise edition.

pjmlp 3 days ago | parent | next [-]

That has nothing to do with OpenJDK, GraalVM is its own thing.

cowsandmilk 3 days ago | parent [-]

You’re the only one who put “Open” in there. Both your parent and grandparent said JDK.

pron 3 days ago | parent | next [-]

GraalVM is a separate product developed by an unrelated team. Its enterprise flavour is not considered an enterprise flavour of the JDK. The closest to an enterprise JDK from Oracle I can think of is the "Enterprise Performance Pack" for the 12-year-old Java 8, but it has nothing that isn't in the free and open recent releases (which actually include many more performance enhancements).

The idea there is that it's cheaper for companies with legacy software that isn't actively maintained to pay for some portion of the performance improvements in modern JVM generations than to ramp up maintenance to upgrade to modern Java, and this can help fund the continued evolution of OpenJDK.

kobebrookskC3 2 days ago | parent [-]

what happens when the legacy code is migrated to the new java, which is supposedly easier to upgrade post java 8? who will pay for long term support if upgrading is so easy?

pron 2 days ago | parent [-]

There's always legacy systems; it's part of the natural lifecycle of software. Also, what you buy is any kind of support, regardless of the version you're on. Support doesn't mean access to patches but an SLA for the tickets you file.

pjmlp 3 days ago | parent | prev | next [-]

Because people keep forgetting Java is like C and C++, there are plenty of JDKs to chose from, and not all of them are related to the same codebase.

3 days ago | parent | prev [-]
[deleted]
jiehong 3 days ago | parent | prev [-]

Zulu from Azul might be one? I think it comes with a difference JIT and GC in the enterprise version.

vips7L 2 days ago | parent [-]

They have their own falcon jit and C4 low latency GC. I’d be interested how their GC compares to generational ZGC now.

ecshafer 3 days ago | parent | prev | next [-]

OpenJDK is the specification implementation. A huge amount of the OpenJDK development is paid for by Oracle (And others).

reactordev 3 days ago | parent [-]

Because they have a financial interest in rug pulls.

Twirrim 3 days ago | parent | next [-]

What rug pull do you picture could happen at this stage? OpenJDK is the reference spec. Fully open source. Stewarded by multiple companies. Even if Oracle somehow managed to force the whole thing closed source (not sure that's even possible?) you've got all the other contributors who'd "hell no", fork and away you go. Which version of Java do you think the community would go with? There's no way it'd work.

dialogbox 3 days ago | parent | prev [-]

Why do you think a good steward shouldn't have a financial interest?

pjmlp 3 days ago | parent | prev | next [-]

Nope, people keep forgetting no one wanted to buy Sun, not even Google after torpedoing it (which would save them from their J++ like lawsuit).

IBM kind of thought of it, but ended up withdrawing the offer.

So the anti-Oracle folks would have seen Java wither and die in version 6, and the MaximeVM technology would never had been released as GraalVM.

exabrial 3 days ago | parent | prev [-]

`sdk install java 21.0.8.fx-librca`

No pre-core fee needed.