Abc def ghi jkl mno pqrst

Java-Software “Läuft auf allen Betriebs-Systemen” mit Java Runtime Environment!
So jedenfalls die meist gelesene Aussage!
Die (Plattform-spezifische?) JRE kümmert sich um die Ausführung einer in JAVA programmierten Software!
Der Programmierer muss also keinen Gedanken daran verschwenden, auf welchem Betriebs-System seine Software einmal ausgeführt werden soll.
Weshalb stellen dann ‘Anbieter’ (auch von FREIER Software) u.a. spezielle ‘Versionen’ (?) für z.B. Mac, Windows, Linux zum Download bereit?

Java software “Runs on all operating systems” with Java Runtime Environment!
So at least the most widely read statement!
The (platform-specific?) JRE takes care of the execution of software programmed in JAVA!
The programmer does not have to worry about which operating system his software should run on.
Why then put ‘vendors’ (including FREE software) u.a. special ‘versions’ (?) for e.g. Mac, Windows, Linux ready for download?

I am not sure if you are referring to “vendors” of applications implemented in Java or of the Java runtime itself.

For the Java runtime it should be clear: This is needed to run Java applications, but the runtime itself needs to make this work on a specific platform. Thus the runtime is for a specific platform.

For applications the basic reason usually is installation: You still have to provide the application in a form that the user is used to. That means packaging it up as a Windows installer or a macOS app bundle (or a .hpkg file on Haiku of course). It also needs to be integrated into the environment with e.g. start menu entries etc. Different operating systems provide different things users expect applications to integrate with. Also the user might not have the Java runtime installed, it might make sense to bundle this, too. And again this is very platform specific.

Furthermore depending on the application it might contain further platform specific code, e.g. if it needs certain hardware access for which there are different interfaces on different operating systems. These parts could be implemented by runtime checks, but applications might also contain compiled platform specific pieces in addition to the pure Java byte code.

In the end you can really argue about the common “Java is platform independent” argument. Yes, you can run a basic program in Java byte code on every platform that has a JRE. But this JRE needs to be ported first. And most real world applications will need some platform specific tweaks or at least packaging. IMHO the most portable language is still C :smiley:


First of all, THANK YOU for this detailed answer!

Is it to be understood that the makers of Ancestris made the wrong decision - to program and make available FREE software for all common operating systems?

Java is not crossplatform. Java is still platform specififc. The runtimes tend to try to simplify the interface, but if you have ever tried to write any kind of non trivial Java CRUD/Web type application code, you quickly fall in to JNI hell. I support a bunch of native code and we provide Java interfaces for pure Java and Android and it is a labour. You either use JNI and write a lot of extra code per platform, or you can try to get away with one of the dynamic runtimes like JNA, but it is very hit or miss.

No, not necessarily. Java totally is suited for doing this. But it is not a magic wand. What I really wanted to explain is that cross platform development involves more than just getting a small piece if code to execute.

Your original question was also why there is a need for platform specific packages. This goes beyond just having the code run somehow, but to also allow the user to install it and set everything up in an easy way (which means usually in a way typical to the user’s platform). This is all well outside the scope of what Java and the Java runtime do solve.

In the end the developers always have to be aware of portability across platforms if this is a goal. If you want you can write highly portable applications in C, if you are careless you can end up with something highly unportable in Java.

That Java promise of “write once, run anywhere” is to a large degree also just marketing blah blah. It sounds nice to be able to run exactly the same compiled code on different systems. But in the end this often is not the biggest hurdle when distributing more complex software.

Still this ability can be a plus of Java. Some software is provided as plain jar files, and with some instructions on how to install the JRE and execute the program with it you can make it run on any system with a JRE.

As to what made it difficult to run Ancestris on Haiku I do not know. I have seen the separate thread about this, but haven’t watched it in detail.

1 Like