When I started using Java in the nineties, it was all "Write once, run anywhere!" from day one. That was probably all true then and I was a part of the choir as well.

I am not sure what to think about that anymore, considering all the other languages using multi platform runtimes (python, flash, perl, html, php...). But I am still seeing lots of arguments that says you should use Java because it is supposedly better for cross platform development.

So, Is that still true today? Is Java still the language of choice for multi platform development?

  • Please be specific with focus on cross platform aspects.
  • I am not asking for general language feature comparisons.

Update: Great responses so far! Most answers seems to be favoring Java or web. Any input from the script crowd?

  • See also: programmers.stackexchange.com/questions/15610/… Commented Nov 19, 2010 at 12:26
  • 3
    This comment doesn't address the heart of the question, but it is a factor to consider: Java-based web apps targeted at Windows users are something to stay away from. The Oracle JVM for Windows has had a lot security issues lately. As such, you may find that savvy users won't use Java-based web apps because they've uninstalled the JVM.
    – poke
    Commented Jan 5, 2013 at 21:26
  • Your question is based on the assumption that it was even the cross platform language of choice to begin with.
    – oxr463
    Commented Jul 12, 2019 at 2:55

7 Answers 7


scripting style languages such as python also make cross platform development easier. Now, whether you like Python (or other such languages) depends on you, and we probably don't need to start that debate here.

Java tries to force you to write code which will run portably, while python allows you to write portable code. The actual python language itself will run portably, but external libraries may or may not. Additionally, python will freely give access to platform specific services.

Does Java an advantage there? I think in either case you can write the portable code with similar ease. That is, you can write code and it will usually work on different platforms. But you cannot get away with just writing code and assuming it will work everywhere. I've worked on a python project which produced version for Windows, Linux, and Mac and we ran into very few cross platform issues. (The only one I remember was due to a bug in the library we were using pygame, which caused drawing issues on Linux. This was fixed by upgrading the version of pygame we used)

Another issue is deployment. If you want to distribute standalone programs that run your code you will have to produce different versions for different platforms. For Java you can distribute one version and assume that the user has Java installed or can install it. In this case Java probably wins in the simplicity of deployment department.

In the end, I think it comes down to what language you like working with and what kind of deployment you need to perform.


While Java may not be the or the only viable cross-platform tool, it has some strengths:

  • It's extremely fast.
  • It's extremely robust.
  • It's extremely portable (e.g. bytecode compiled 10 years ago in Windows 95 runs fine in OS X today).

and some weaknesses:

  • Core GUI libraries (Swing...) are showing their age (3rd party additions help here).
  • The language itself could be less verbose (e.g. checked exceptions...).
  • Startup time could be snappier (although it's improving all the time).

When talking specifically about Java the platform, there's one point more:

  • There are quite a few languages that run on the JVM and interoperate with Java.
  • 19
    Extremely fast? Compared to what?
    – HardCode
    Commented Nov 19, 2010 at 22:22
  • 19
    @HardCode: Compared to any interpreted language or most compiled languages. C and C++ can be made faster in some cases but it's hard, and keeps getting harder when number of cores grow. With Java concurrency (utilizing those multiple cores efficiently) is way easier to achieve in practice. Commented Nov 20, 2010 at 6:56
  • 5
    @HardCode, apparently the JVM is the fastest runtime available for almost any interpreted language (as opposed to the ones the language hackers made themselves)
    – user1249
    Commented Jan 20, 2011 at 12:45

It's as true today as it was back then - that is to say not entirely. Java is write once, test and debug everywhere. Sure that's a lot less work than a completely fresh port but it's generally more work than the initial hype had us believe.

Our product has a Java server which will run on either Windows or Linux but we have seen OS specific issues with it and make sure we have both Linux and Windows servers available for support / testing if needed. Java UIs tend to have more issues than the servers (though many are cosmetic and therefore potentially can be ignored depending on the application).

While not strictly a language for me the web is the cross platform platform of choice. An HTML / JavaScript front end means that your application will run on pretty much any client platform and in most instances that was the real goal - not having to worry whether it was a Mac or a PC, which OS version and so on.

Of course you'll generally still be dictating the server platform but when it's just that people become a lot more flexible, particularly these days when most companies already support a mix of Windows and Linux servers.

  • 8
    Good answer. Of course, making sure your app works right in all the various browser versions can be a headache as well. Commented Nov 19, 2010 at 15:51
  • 5
    @Tim: good point. I believe browser apps are much more "test and debug everywhere" than Java desktop apps. Commented Nov 19, 2010 at 18:28
  • 5
    @Tim: +1. Getting a webapp app to work the same across all the major browsers is just as hard as getting a Java app to work the same across multiple OS's. Commented Nov 20, 2010 at 7:57
  • 3
    "write once, debug everywhere" is not true in my experience. as long as you are sensible and avoid platform-specific dependencies, I've had no issues running the same Java code on multiple platforms (including GUI ones). Yes of course you should test it, but I think in nearly 15 years of coding Java I only once had a real portability issue (which was my own fault for hard-coding Windows directory separators rather than using Java's helpfully cross-platform File.pathSeparator!)
    – mikera
    Commented Feb 14, 2011 at 17:09
  • 2
    @mikera - We've seen issues between Linux and Windows which were nothing to do with our code. They're rare but they do exist. Commented Feb 14, 2011 at 17:33

Personally, I'd say that Java is still the cross platform language of choice, and likely to remain there for some time (alongside web applications). I wrote some more on the topic in this post on Java as a platform of choice, but on the cross platform front in particular:

  • As long as your are careful with your dependencies (e.g. avoiding libraries that use JNI to interface with native code) then Java can be written run unmodified on all the major JVM platforms

  • Beacuse Java is usually distributed as machine-independent bytecode, you can run without recompilation on any JVM (since the local JVM itself handles JIT-compilation to native code). For example, I've succeeded in getting a reasonable complex GUI app to run first time on a Mac after developing in Windows - with the same jar file. Contrast that to most other cross-platform languages, which typically require different libraries or a recompile for a different platform.

  • A lot of the core libraries you need (GUI, networking, IO etc.) are part of the standard runtime and written in a cross-platform way. So you don't need to go hunting for and testing cross-platform libraries, you are guaranteed that pretty much everything you need is already there in the runtime environment.


I think you have those choices:

1) use either a

  • compiled or
  • interpreted language.

2) How will you package and deliver your code?

  • One "front-end", one binary/script?
  • One "front-end", multiple binaries/scripts?
  • Multiple "front-ends", multiple binaries/scripts?

Those choices affect performance, soure code visibility and distribution.

Do you mind giving away your source code? Compiled languages might be for you. Compiled languages seem to perform better in micro-benchmarks than interpreted (even JITed) languages. Also if you depend on a runtime environment like Java, Python, Ruby etc your code might be harder to distribute.

I found that most popular cross-platform desktop applications go for "One front-end, multiple binaries" using C/C++ and a crosss-platform widget library, e.g.Audacity, Blender, Firefox, Google Earth, OpenOffice, Skype, Songbird, Stellarium, VLC.

  • You made an interesting error listing Skype in your examples, but this super-popular application actually was started with Delphi/Pascal on Windows and ported with C/C++ on linux and Objective-C on MacOS/iPhone
    – Maksee
    Commented Nov 19, 2010 at 15:36
  • I think the compiled / interpreted dichotomy is a little misleading - Java is in some sense neither because it is compiled to machine-independent bytecode for distribution (i.e. no longer in source form), and then JIT compiled at a later time into native code on whatever machine you are running on. It's fully cross platform, but also gets you native performance, plus you don't have to distribute your source if you don't want to. win/win/win.
    – mikera
    Commented Feb 14, 2011 at 17:03

I'll say no. python and ruby are used a lot and so is javascript for both client and server side. I personally use .NET and have no problems getting it to run on mac and linux (while developing on windows)

-edit- i hear LLVM is becoming popular but is still extremely small. That will allow you to use cross platform C++ in a single binary. Apparently it will be executed on browser but i havent seen an example where it allows you to modify the dom or call javascript.

  • LLVM is not about running on a browser... Are you talking about emscripten? Commented Jul 10, 2014 at 1:55
  • check the date. 4 years ago emscripten didn't exist. NativeClient was suppose to work (and had doom running) but it didn't.
    – user2528
    Commented Jul 10, 2014 at 4:48
  • Now I see the date, but still, LLVM was never specifically about browsers, right? Commented Jul 10, 2014 at 6:20
  • 1
    Nope. Although I wish I could write C++ or some other language LLVM supports instead of JS...
    – user2528
    Commented Jul 10, 2014 at 10:38
  • In that regard... Commented Jul 11, 2014 at 2:14

If you bring mobile platforms into the mix then you'd also at least need to include recompile. E.g. android, j2me.

Not the answer you're looking for? Browse other questions tagged or ask your own question.