Quote Originally Posted by Joacim Andersson View Post
Yes, you can write a Java program that runs on multiple platforms but only if you go for the least common denominator. Try for example to write a program that runs on Android in Java and then just move that to any other platform and it will fail (unless it's very basic), simply because you want to use the specific APIs that exists on the platform you're writing the code for. Actually the Android platform makes it even worse because of the many different devices that uses it. Just have a look in the Google Play store and see how many applications that exist in there that is only available for certain devices as opposed to any Android device.
I would not expect Android Java to be portable mainly because Android applications follow a specific model rather similar actually (amazingly?) to the model used by WinRT appplications. This is not how a "desktop" application's flow commences at all.

Conventional Java desktop (WIMP) applications and command line applications can be quite portable though. Probably the biggest platform difference for these is packaging for deployment. If you're willing to just drop a .JAR file somewhere and run that (no Start Menu shortcuts, no app data folders set up, etc.) then portability is almost a given. Such simple programs can be very useful, things on the level of most projects we get question threads on here which consist of a lot of personal use or limited shared in-house use.

It is quite true that every platform has differences that need attention if your program is to "look right" and act as users expect it to. Of course at the same time in question threads here people reveal that they routinely break Windows Guidelines left and right anyway even using Microsoft tools.


The biggest advantage Java has is that the language itself can take you anywhere. You aren't locked into a dying platform (WinPhone, WinRT, and Win8).