News for hackers. Stuff that matters.
Re:Java 16 by hota_mazi on Tuesday March 16, 2021 @02:32PM (#26480900)
> For example, it's more or less impossible to write a Java program that runs on Windows, Android, and iOS

Not only is it possible, it happens all the time.

The entire Maven Central repository, which contains tens of thousands of JVM libraries, is usable on all the platforms you just listed.

If that's not portability, I don't know what is.

Re:Java 16 by kllrnohj on Tuesday March 16, 2021 @02:48PM (#26481137)
Maven runs on 1 out of the 4 mentioned platforms. There are no Android, iOS, or web builds of Maven.

Maven is used to ship dependences for the other platforms, but it is not run itself on those other platforms. Shipping an Android-specific library on Maven isn't magically portable (which is what's common here - OS-specific libraries on Maven). It's still Android-specific.

Re:Java 16 by hota_mazi on Tuesday March 16, 2021 @02:52PM (#26481203)
All Android builds use Gradle and download their dependencies from Maven Central.

I have no idea what you're talking about.

Let me repeat this: all Windows, macOS, Linux, and Android apps that use Maven or Gradle to build ALL download their dependencies from Maven Central. These are the very same libraries, same bytecode.

For example, do you use Mockito? You will download that exact same library from Maven Central regardless of the platform you are building on.

Re:Java 16 by kllrnohj on Tuesday March 16, 2021 @02:57PM (#26481270)
When you build Android you're not building it on Android, you're building it on Windows, MacOS, or Linux. Maven itself is not being run on Android or iOS.

The Java code that powers Maven isn't portable. The AndroidX code hosted on Maven that everyone is pulling down for Android isn't portable, either.

Your claim would be like saying that PHP is portable because every platform has a web browser that can talk to the server running modphp. That's not what portability means.

> For example, do you use Mockito? You will download that exact same library from Maven Central regardless of the platform you are building on.

Mockito only runs on 2 of the 4 platforms (doesn't run on iOS or web).

Re:Java 16 by hota_mazi on Tuesday March 16, 2021 @03:12PM (#26481458)
Who cares about Maven-the-app, we are talking about the portability of the JVM bytecode.

There are gigs of JVM bytecodes stored on Maven Central and these bytecodes are being downloaded and run on macOS, Windows, Linux, and Android on a daily basis without a single change. The very same libraries. Unchanged.

That's the very definition of portability.

I don't understand why you keep shifting topics by bringing up irrelevant observations.

Re:Java 16 by ptx on Tuesday March 16, 2021 @05:15PM (#26483077)
Any libraries in the Maven repos that rely on JNI have to include platform-specific native libraries for each platform. For example, anything that uses Unix-domain sockets, which weren't supported in Java until this very release.
Re:Java 16 by kllrnohj on Tuesday March 16, 2021 @03:24PM (#26481615)
There's no portability requirement to being on Maven Central. Maven Central regularly hosts non-portable bytecode - like every AndroidX library.

And, again, none of those libraries run on Windows, Android, iOS, and web - the 4 major platforms by market share. At best you get half of those, but typically you don't even get that, and that's still only libraries. None of them are portable applications.

It's trivial to write semi-portable C++ snippets, too, that's not a major achievement.

Re:Java 16 by hota_mazi on Tuesday March 16, 2021 @04:54PM (#26482826)
Now you're being intentionally obtuse and moving the goal posts from your original claims just to score points.

You're not arguing in good faith.

Feel free to stick with your invalid views on portability, the rest of us JVM developers will keep enjoying the portability that this wonderful technology provides us.

Re:Java 16 by kllrnohj on Wednesday March 17, 2021 @01:25AM (#26486896)
Me: You can't write a portable Java app that runs on the 4 major platforms (windows, android, ios, web)

You: But <thing that doesn't do that>!

Me: But it doesn't do that?

You: moving goalposts! obtuse!