I am a newbie to Java, somebody clarify my doubt about platform independency, I know Java is a platform independent language,and JVM is platform dependent but is Java Compiler Platform independent?
There are four elements involved in your question:
java MyMainClass
.)Items 1 and 3 are platform-independent (unless your program uses platform-dependent, external libraries). Items 2 and 4 are platform-dependent (that is, each platform--Windows, Linux, Mac, etc.--uses its own version of javac and the JVM).
The result is that you can compile your Java program on any platform that runs javac and then execute the program on that same platform or on any other platform that has a JVM.