Java and .NET are two languages targeted at removing platform dependence. This is achieved by adding a virtual machine/framework between the code and the OS.
So, what is the point in using it on the server side, as all websites are accessible via browser, and that is platform independent? Is there any special reason for using them?
.NET is meant for the Windows platform only. Java is the only one of the two that is meant to be platform independent.
These languages have a strong presence on the server end for many reasons:
- Lots of libraries that handle the subtasks of the problem
- Both frameworks are built with security in mind
- They are managed languages, it is much harder to pull off the typical attacks on software.
- They are considered to be mature technologies, they have been put to quite a bit of abuse and have stood the test.
- They have industry support.
- Both are object oriented
- This means that there is the ability to either develop a web site through the use of reusable components or third party components.
- Both language allow "sandboxing" of non-managed components (Java: JNI .NET: Boxing) [allows inclusion of legacy components]
They're actually chosen for almost completely opposite reasons:
- Java's platform independance means you're not tied to one platform and are thus more flexible in choosing the most cost-effective platform, or the most reliable one. And you can keep your apps running even when you have to change server platforms because the old one isn't supported anymore.
- .NET is chosen because if you're going to tie yourself to an OS, Microsoft is the biggest player and thus the least risky option - or simply because companies fell into the "All-Microsoft shop" trap through gateway drugs like Exchange. And once you're there, .NET is what Microsoft wants you to use and supports and integrates with all their current tools.