Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How java solved portability?

Java compiler converts java code to bytecode and then JVM converts bytecode to machine instructions . As far as I have understood , JVM are built for different platforms (processor + OS) then how can we say that java is platform independent . Ultimately we require a JVM which is platform dependent ?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

The end-user writes code in java and that is platform independent.

The JVM engineer works on creating the JVM and the JRE and within it the compiler and the interpreter for different platforms. Therefore that absolves the end-user to worry about porting their codebase to different platforms. Write once and then run it on all platforms (as long as there is a JVM available for that platform).

So from the perspective of the end-user (Java programmer) the java code is indeed platform independent. Even though the JVM is ported to different platforms and is indeed platform dependent.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading