answersLogoWhite

0

Why JVM is platform independent?

Updated: 8/10/2023
User Avatar

Wiki User

14y ago

Best Answer

by creating a jre spesific to each platform programmers can confidently write code in any platform and assume it willl also work in aany other. theirfore java is platform independent as bytecode would look the same on any platform, however will be implemented by a diffrent interpreter for each platform.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

6y ago

Java is not fully platform independent language but it called also partially,not fully because the Java Run time Environment (JRE) has been ported to just about every platform there is. The same code will run in the JRE for any platform without any modification in most cases.we can also compilation the java byte code in other machine without environment,but class file is not a run in other machine without environment so java is not a fully platform independent language's is partially.
When a Java program is complied, it results is a bytecode. A bytecode is machine independent. That is, you can take the bytecode on a computer w/ any OS, hardware, processor, etc, and run it successfully there.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

Because all Java bytecode runs on the Java JVM, which in turn runs on top of the OS. Thus, Java separates the execution environment from the OS, making the Java code machine independent. The same Java code can be run on pretty much any machine, provided that a JVm is available.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

The result of a Java application is independent of the platform being run. Running a Java application from a Windows computer has the same result as the same application being run on Ubuntu/Linux or on the OS X Mac computer.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

JVM means Java Virtual Machine. Java has been designed in such a way that makes it platform independent and can work on any type of operating system and platform provided JVM is installed in it.

So, consider a system in which JVM is installed.

Java works in the following way..

1)Source code is written

2)Source code is converted into an intermediate format known as byte code by JAVAC(These are not machine instructions but just an intermediate format - format between Java source code and machine instruction). Java byte codes obtained from javac can be executed on any platform and OS provided JVM is installed in it. Byte codes are instructions that the Java virtual machine executes. So, we can say that JVM is platform dependent but Java is platform independent. Once the byte codes are available from JAVAC, it is fed as input to JVM.. Based on the type of platform and OS(which shows that JVM is machine dependent, that is it depends on the OS EX: windows, Linux etc..) , the JVM executes the byte codes.

Finally I would like to conclude by telling that,

Java byte codes are platform independent but Java virtual Machine is platform dependent.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

While compiling the JAVA code, a file with .class extension is created. This file consists of Byte code, which will be understand by machine. when we execute that class file in another platform, that machine reads the class file and executes. For reading that class file each platform has its own JVM(Java Virtual Machine).

The .class file is platform independent. But JVM is Platform Dependent..

Now I am asking How can you say that Java is Platform Independent... will anybody answer for it..

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

It is not. Visit java.sun.com and dowload the suitable JRE (or JDK) version for your platform.

Note: The java bytecode executed by JVM is indeed platfom-independent.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

java is a platform independent language bcoz it depend on jvm . jvm is a virtual machine which can run anywhere on any os.

This answer is:
User Avatar

User Avatar

Wiki User

10y ago

That means that a program designed with the Java language works on many different types of computers.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why JVM is platform independent?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Why is Java not 100 percent platform independent?

AnswerJava is platform independent while JVM is platform dependent. In Java ,you can compile code in to class file and you can run it in any OS without altering your code.But for interpreting class to bytes we need JVM .so it act as a bridge between your class file and OS. Now a days JVM is available for all OS.So Java attains platform independent.AnswerDepending on your definitions, no language may be truly platform independent. A language like Java needs a virtual machine to run the platform independent bytecode. But this virtual machine must run natively on a given physical machine, which means that the JVM in platform dependent. If someone tells you that Java is not completely platform independent, this is probably what they are referring to.


Is Jvm in the system?

The JVM (Java Virtual Machine) is a part of the JRE (Java Runtime Environment).The JRE is comprised of the JVM and the Class Library.The JVM takes the java language and compiles it into Bytecode which can then be interpreted as machine code by the platform(OS). The JVM will compile byte code specific to the OS it is being deployed upon. The JVM allows the Java language to be platform independent.


Is Java is platform dependent or independent?

Java is not machine dependent. High-level Java source code is compiled against the JVM which produces Java byte code, the lower-level native language of the JVM. At runtime, the JVM interprets the byte code to produce the required machine-dependent code. Every platform that supports Java has its own JVM, thus the same byte code can execute upon any supported platform. The translation from byte code to machine-dependent code is handled solely by the platform JVM.


What are the two Java platform components?

Jvm & api


Why is the JVM platform dependent?

That depends on how you look at it. The point of the JVM is to allow Java bytecode to be executed on any platform, regardless of what machine it was compiled on. The actual implementation of the JVM, however, must be platform-specific.

Related questions

Are JVM is platform independent?

No, they must be designed for specific platforms. The compiled programs are platform-independent.


Why is Java not 100 percent platform independent?

AnswerJava is platform independent while JVM is platform dependent. In Java ,you can compile code in to class file and you can run it in any OS without altering your code.But for interpreting class to bytes we need JVM .so it act as a bridge between your class file and OS. Now a days JVM is available for all OS.So Java attains platform independent.AnswerDepending on your definitions, no language may be truly platform independent. A language like Java needs a virtual machine to run the platform independent bytecode. But this virtual machine must run natively on a given physical machine, which means that the JVM in platform dependent. If someone tells you that Java is not completely platform independent, this is probably what they are referring to.


Why java is called platform independent not operating system independent?

A "platform" is whatever environment in which Java is running. This includes operating systems. A Java source file on compilation produces an intermediary .class rather than a executable file. This .class file is interpreted by the JVM. Since JVM acts as an intermediary layer.


Is Jvm in the system?

The JVM (Java Virtual Machine) is a part of the JRE (Java Runtime Environment).The JRE is comprised of the JVM and the Class Library.The JVM takes the java language and compiles it into Bytecode which can then be interpreted as machine code by the platform(OS). The JVM will compile byte code specific to the OS it is being deployed upon. The JVM allows the Java language to be platform independent.


Is Java is platform dependent or independent?

Java is not machine dependent. High-level Java source code is compiled against the JVM which produces Java byte code, the lower-level native language of the JVM. At runtime, the JVM interprets the byte code to produce the required machine-dependent code. Every platform that supports Java has its own JVM, thus the same byte code can execute upon any supported platform. The translation from byte code to machine-dependent code is handled solely by the platform JVM.


JVM is platform dependent then why JAVA is platform independent?

The idea is that, once you have a JVM available for a platform, the same Java program works on different computers. This is unlike many other programming languages, which need to be recompiled for different platforms, or perhaps don't work even if recompiled, due to platform-specific differences.


Why java called platform indeependent?

Platform independent language means once compiled you can execute the program on any platform (OS). Java is platform independent. Because the Java compiler converts the source code to bytecode, which is Intermidiate Language. Bytecode can be executed on any platform (OS) using JVM( Java Virtual Machine).


What are the two Java platform components?

Jvm & api


Why is the JVM platform dependent?

That depends on how you look at it. The point of the JVM is to allow Java bytecode to be executed on any platform, regardless of what machine it was compiled on. The actual implementation of the JVM, however, must be platform-specific.


Why java is platform independent explain by diagram?

Java is a platform independent language becoz of the bytecode magic of java. In java, when we execute the source code...it generates the .class file comprising the bytecodes. Bytecodes are easily interpreted by JVM which is available with every type of OS we install.


How java platform independent with complete architecture?

java is platform independent because java code is compile on javac compiler after create one class file this file is run any of paltform run this code becauase jvm is understand this code properly managed. jatin patel


Who makes java platform independent?

JVM makes Java Platform Independent.. It loads byte code(.class file) and Run it.