Platform independency

I want to the exact meaning of platform independency because if we take a language like C programs can be run wihout installing C compiler. But JRE is compulsory for java..

[179 byte] By [Raghu_nca] at [2007-11-27 11:46:29]
# 1

If you take a C program compiled on a pc it is unlikely it will run on a Mac. It also doubtful you will get the same result if you run the same program on two different pc's.

However, if you compile a Java program on a pc, then there is a very high probably that it will run on any machine. As long as that machine has the corresponding JVM installed.

floundera at 2007-7-29 18:07:50 > top of Java-index,Java Essentials,New To Java...
# 2

hi ragu.I would like to correct u that you dont need a compiler to run a program. C compiler is a must to run a program. Compilers vary.

Jitu-javaa at 2007-7-29 18:07:50 > top of Java-index,Java Essentials,New To Java...
# 3

i mean.. for running an exe C file compiler isn't necessary..

Raghu_nca at 2007-7-29 18:07:50 > top of Java-index,Java Essentials,New To Java...
# 4

True, but like flounder said: your (Windows-specific) exe won't run on Linux, or Mac(*).

(*)Wine, emulators and virtualisation notwithstanding

Herko_ter_Horsta at 2007-7-29 18:07:50 > top of Java-index,Java Essentials,New To Java...
# 5

To run a JAR file containing Java classes, you won't need the Java compiler (javac).

You write and compile a Java program only once, and run it on all platforms with the same behavior and without any problems. This is called platform independence, which is not the case in a language like C or C++.

jaxiana at 2007-7-29 18:07:50 > top of Java-index,Java Essentials,New To Java...
# 6

> To run a JAR file containing Java classes, you won't

> need the Java compiler (javac).

>

> You write and compile a Java program only once, and

> run it on all platforms with the same behavior and

> without any problems.

Not quite true. Platform independence in practice means that no re-compilation is needed, that the binaries will run on another OS that has a JVM. There are issues with code behaving slightly differently on different OS's though

georgemca at 2007-7-29 18:07:50 > top of Java-index,Java Essentials,New To Java...
# 7

This thread seems to be shrinking in size. As are a few others. What's going on?

georgemca at 2007-7-29 18:07:50 > top of Java-index,Java Essentials,New To Java...