3 ms·
> 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. T
by hota_mazi 6y ago
> 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.
- kllrnohj 6y agoMaven 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.
- hota_mazi 6y agoAll 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.
- kllrnohj 6y agoWhen 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).
- hota_mazi 6y agoWho 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.
- kllrnohj 6y agoThere'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.
- hota_mazi 6y agoNow 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.
- kllrnohj 6y agoMe: 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!
- ptx 6y agoAny 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.