Well as I know that it works in any OS (Thats what they taught me on university) it works in windows , linux and any other OS without the need of adding any library or changing anything in the code.
and here
Why Java?
* Similar to C++ so it is familiar to commercial programmers.
* Does not include the nasty dangerous parts of C++ so it is safe.
* Extensive run-time type information and safe dynamic link-loading is available.
* Includes string and multi-thread support in the language.
* Automatic memory management.
* Data type sizes and arithmetic behaviour are fixed and fully defined for all platforms.
* Has useful standard OO libraries.
* Documentation can be extracted from the source code.
* Security checking is built in to the libraries and virtual machine.
* Supports unicode for ease of internationalisation.
* Write once, run anywhere, any platform (no porting, no client configuration .. well almost!)
* Vast amount of supplier and programmer support and acceptance. It is unkillable.
* Loads and runs over the WWW, 40 million potential clients.