user9152856
user9152856

Reputation: 109

In case of web applications, why java is also called platform independent?

In case of desktop applications, it is clear that Java is a platform independent, because you do not need to compile the java desktop application on each OS to run appropriately.. it is enough to have a JVM installed on the targeted OS, to run the application.

But I can not see that concept clearly in case of web applications, because if you want to run a web that developed in Java programming language, you need a JDK installed in the server and an apache (especially Tomcat) web server, and once the web is created, it will stay on the server and it will be requested with a client web browser. This is the opposite of the previous case (desktop applications), in which each client must obtain a .jar file to run the java application (independently of his OS).

So where is the irony? And how can we benefit from the platform-independent issue in that case?

Upvotes: 0

Views: 345

Answers (1)

Andreas
Andreas

Reputation: 159215

Java is platform independent

That means that Java can run on any platform with a JRE installed, without having to recompile the code.

For desktop applications, that means the desktop computer can be Windows, Linux, macOS, etc.

For web applications1, that means the server machine can be Windows, Linux, macOS, etc.

It is exactly the same thing. No irony.

1) Note that web applications don't necessarily require any "Apache web server". You can write Java web applications that are their own web server software. All that is needed is the JRE.

Upvotes: 8

Related Questions