Why java is called platform independent language ?

Why java is called platform independent language

One of the major features of java includes that why java is called platform independent language.
Before understanding this feature we need to know about –

Javac – compiler that converts source code to byte code.
JVM- interpreter that converts byte code to machine language code.
As we know java is both compiler & interpreter based language. Once the java code also known as source code is compiled, it gets converted to native code known as BYTE CODE which is portable & can be easily executed on all operating systems. Byte code generated is basically represented in hexa decimal format. This format is same on every platform be it Solaris work station or Macintosh, windows or Linux. After compilation, the interpreter reads the generated byte code & translates it according to the host machine. . Byte code is interpreted by Java Virtual Machine which is available with all the operating systems we install. so to port Java programs to a new platform all that is required is to port the interpreter and some of the library routines.
Source code -> javac ->Universal byte code

Universal byte ->jvm/java -> execute them on a particular machine.

Another reason the makes Java a Platform independent language is the elimination of undefined or architecture dependent constructs.
Therefore java is called platform independent language.


  1. Neat Explanation!!!!

    • when you compile java program on one operating system then java compiler generates byte code.you can run that byte code on any operating system which has jvm.jvm is understanding byte code and generating native code for the corresponding operating system.because of byte code and jvm,java is platform independent u can use write once run anywhere……

  2. very nice explanation

  3. Good explanation.. I am a java learner
    you mentioned elimination of architecture dependent constructs.
    could you explain it in detail

    • Yaa see there are two sides one is the client side programming and other is the server side

      So when ever you put code in the server it gets loaded and we can see it

      So a person in any country can see the output loaded by ur code

      So java dosent need operating system but again jvm needs to execute itself

      But java initially dosent need any operating system and any particular hardware

  4. best explanation.

  5. its good.so helpfil

  6. Good Answer

  7. best understandable….thanks

  8. awesome!!!!!!!

  9. that’s really good to understand…thank u so much:)

  10. Very useful in beginners

  11. i want to exact meaning of why java is platform independent. ur ans is fine but i want more exact ans.

  12. shot and sweet

  13. krishnanand krishnmurti

    you have very well definition given to me that how of this java platform independent language and good explanation.so i am very happy after getting this definition.

  14. Very helpful thanks a lot

  15. precise explaination.

  16. Gud explanation

  17. Thank you,It helped me

  18. now this is some what near to the correct explanation. Good for people who are starting new.

  19. what is called the javaplatform independence? of meaning

  20. Why we need to compile Java code in one Operating System and Why we need to compile in another Operating System.What is the neccessity.
    Please explain..

  21. thank you ,it is very helpful to me

  22. mmmm…
    really good for bigginners

  23. Very nice…. Helpful for quick review

  24. very helpful and easy explanation

  25. super explanation thankyou

  26. shivam srivastava

    Very helpful

  27. just short and easy explaination

  28. very nice way to explain!!!!!

  29. Simple and a Clean explanation. Thanks

  30. Simply best explanation!

  31. very good answer ,thanks much

  32. very good answer ,thanks much.

  33. Very nice Explanation

  34. Thank you so much. Every term is explained very clearly. Here I found what I want about JAVA. All concepts are clear now.

  35. vignesh balakrishnan venkatesh kumar

    please explain brief

Leave a Reply

Your email address will not be published. Required fields are marked *