answersLogoWhite

0


Best Answer

Java source code is compiled into .class files, which are used by the Java Virtual Machine (JVM). The format of the .class file is the same for all platforms, and so the source code can be compiled the same way on each platform. The JVM, however, needs to be written to run on a specific platform. This is the part which converts Java bytecode to native bytecode, and is why you need to download the JRE (which contains the JVM) for a specific platform. Java source code is compiled into .class files, which are used by the Java Virtual Machine (JVM). The format of the .class file is the same for all platforms, and so the source code can be compiled the same way on each platform. The JVM, however, needs to be written to run on a specific platform. This is the part which converts Java bytecode to native bytecode, and is why you need to download the JRE (which contains the JVM) for a specific platform.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How is it possible that the same Java program can run on different platforms?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Why java is platform independent and also prove how it is possible?

WHY MEANS the java is a platform independent language for the sake of it has its own platform to run the program it doesn't require any platforms like c and C++


Why is java popular?

One version of a program will work on all major OS'. Business uses it because it's more secure i believe.


Platform independent languages?

That refers to programming languages, and specifically to languages that run on many different platforms. An example is Java, which runs on any machine and operating system that has a special program (the JVM, Java Virtual Machine) designed for that "platform".


What does platform-independent language?

That refers to programming languages, and specifically to languages that run on many different platforms. An example is Java, which runs on any machine and operating system that has a special program (the JVM, Java Virtual Machine) designed for that "platform".


Is it possible to create a custom version of java preferably for ipod touch?

It is possible, but very difficult. Sun puts out a special version of Java known as the Micro Edition (ME) specifically made to run on small, portable platforms such as mobile phones. As far as I know, Java ME is not currently supported on the iPhone/iPod touch platforms.


How do you run and compile a java applet program?

One can run and compile a Java applet program by agreeing to the terms and downloading it. It is possible to get a compiler online that will compile and run Java programs.


Is it possible to run java program without JVM?

No. Java programs run in the Java Virtual Machine (JVM) - without it your computer won't know how to handle Java bytecode.


Can a java program has two different variable?

Yes. You can have as many variables as you want in Java


Why cant someone hack a Java program if they know the Java programming language?

Knowing Java does not allow you to hack a Java program because the source code is not available to hackers. Also, a program interprets the bit-code before you see it, so even with a decompiler, hacking the program will not be possible.


What are the names of different part of simple java program?

NO!


Why java was created when there is c plus plus?

Java was created to build a system that was binary code portable across different platforms. The only thing needed was a different run-time, i.e. the virtual machine.In a compiled environment, such as C++, it is necessary to recompile and relink a program before being able to run it on a different platform.


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.