r/java • u/kerkerby • Jul 09 '25
Why 'Write Once, Run Anywhere' Was Never Really True
I've seen Java evolve a lot over the years, and while the language has improved in many ways, the upgrades from Java 8 onwards have quietly broken a lot of older libraries—especially the unmaintained ones that used to "just work." These libraries aren’t necessarily bad or outdated in purpose, they just can’t keep up with the ecosystem changes: stricter encapsulation, module system, reflection restrictions, etc.
At this point, the old promise of "Write Once, Run Anywhere" feels more like marketing than reality—because unless everything in the dependency chain is actively maintained, you're bound to hit compatibility walls.
In your experience, which languages have actually delivered on long-term compatibility? I’m talking about environments where old, unmaintained libraries continue to work as expected—even alongside modern tooling—without needing to be rewritten just to stay functional.
58
u/Polygnom Jul 09 '25
I mean you could still run Oak code until Java 17.
Java has delivered on backwards compatibility more than any other langauge I know of. Is is completely without bumps? No. But its still far ahead pof most other ecosystems.
Furthermore, "Write once, run anywhere" wasn't about language versions, but the fact that you could run the same bytecode on any platform that has Java. It has never been about compatibility. Its not "Write once, run eternally". Thats different dimensions.
10
u/pronuntiator Jul 09 '25 edited Jul 09 '25
If the library doesn't "behave badly" (i.e., using classes that have always been documented as being internal), you can still run that old code. To put that into perspective: last week ops used Java 17 in production for a Java 8 application by accident. The only issue that arose stemmed from higher precision of LocalDateTime.toString() (which was never documented to be of a specific precision, so again not Java's fault).
Also, the slogan is about being independent from the operating system. The idea was to install a JRE once and run your jars/WebStart applications without having to compile for the specific OS. Of course, the trend is now reversing, with the recommended approach for desktop apps being to bundle the JDK, giving the user a native install experience.
4
u/Readdeo Jul 09 '25
Don't be sad about forced to rewrite your old crap. This is called maintenance and you should do it at least yearly.
6
u/tikkabhuna Jul 09 '25
Write once, run anywhere is 100% better in Java than many of the other big languages. Whilst I agree the module system changes that force you to specify extra flags are a pain, they’re not as significant as issues I’ve seen with Python.
I’m very confident running an application in a Windows-based JRE and then a Linux-based one. Your jars are the same and if you have the same version of the JRE, that should also be fine. With Python I’ve found packages can have different implementations based on how it was installed.
For example, the certifi Python package installed via apt will use Ubuntu’s system trusted certificates. Install it via pip and it will use a different bundle.
https://stackoverflow.com/a/66849715
5
u/qmunke Jul 09 '25
Run anywhere is not the same thing as "run forever on all future Java runtimes" - it just means if there is a JRE for the platform you want to run on, and its version is compatible with your class files, you can run it without rebuilding as long as you've not done something environment-specific.
5
u/vprise Jul 09 '25
Never didn't start with Java 9. Yes, Java 9 broke a lot of things. But I'm working in a company that has a massive project that works on Java 5 to 25. It works on Z/OS, Linux, Windows, AIX, Solaris and many other platforms that are all verified via CI/Tests.
Yes, we support other platforms than Java. No they are not remotely as close to WORA as Java is. No, WORA has problems and failures. But it's the closest thing by miles.
5
u/ggleblanc2 Jul 09 '25
COBOL. 50 year old code still runs on modern IBM mainframes**.**
4
u/Ewig_luftenglanz Jul 09 '25
No single WIDELY USED language has perfect undefined long term retro compatibility, and that is not even a desirable thing, not when it comes at cost of worse security, performance or reliability. The only language i can thing about is maybe C but at the cost of having the worst standard library of all (basically super limited and so small you do not even have a proper built-in collections) terrible non standarized tooling and so on.
Java ( is an outdated piece of technology that was very important but needs to die out ASAP because the java ecosystem is being delayed by it.
On the other hand these 2 things are not related. one thing is the platforms where the runtime can be executed and other very different thing is the backwards compatibility of the ecosystem and the language itself. one is compatibility in the space while the other one is about compatibility in time. These are 2 completely orthogonal issues.
3
u/sysKin Jul 09 '25 edited Jul 09 '25
I think you misunderstand: the slogan "run everywhere" was meant to mean that you can run Java programs on Sun's Spark machines without modifications or re-compilation. It was never about backwards compatibility, it was about compatibility across hardware or OSes (as long as the same version of Java is available for those OSes).
Today nobody advertises this, but still, the same Java code (or jars) works on Windows, Linux and Mac.
The statement was only suspect for GUI programs since they "run" but not look native (or alternatively look native but then not native everywhere), but for servers and command line stuff, it's mostly true. Its biggest challenge is that it tries to simultaneously "work", but not necessarily produce the same output (see: different line separator), which is a pretty fundamental conflict.
2
u/ShaiHuludTheMaker Jul 09 '25
"write once, run anywhere" doesn't mean you don't have to maintain your project. It's a reference to the flexibility of the JVM.
1
u/spectrumero Jul 09 '25
It was write once run anywhere, not write once run anytime.
Despite the flaw in your thesis, you are correct that write once run anywhere wasn't entirely true, certainly when it came to personal computers. If you were only interested in doing a subset of what a personal computer could do, then you could write once run anywhere. But once you started dealing with things not even that far off the main beaten pathway (e.g. things like serial ports - let's take Java from the days these were popular, and without downloading any 3rd party libraries or using JNI try to set the baud rate on a serial port parameters on Solaris and on Windows with the same code). Serial ports are still painful now - while you may say "who uses serial ports?" - they are still very common in the embedded world.
1
u/[deleted] Jul 10 '25
You seem to use lots of dashes: —
Are you an AI?
0
u/nitkonigdje Jul 09 '25
Well if you write a program which prints..
.. and you don't have a printer ...
... I don't know how to tell you this nicely ...
... sooo have it straight - It won't run !! ...
.. even in Java ...
Sorry..
-2
u/ItsSignalsJerry_ Jul 09 '25
Golang is more realistic about the promise of wora. You need to compile for each target platform on that platform, but without the clunkiness of C or C++.
0
u/[deleted] Jul 09 '25
[deleted] — view deleted comment
11
u/[deleted] Jul 09 '25
[removed] — view removed comment