Please answer me
February 19, 2007 7:30am CST
Can we compile a java program if we dont have JVM installed on our PC but we have just the javac.exe file. On similar line can we run a java program using java with no JVM installed on Pc. Also can I create a java class without installing JDK on my PC.I think similar questions are asked in interviews also. Please give your answers.
20 Feb 07
We can compile a java program even we don't have an JVM on our PC...because JVM is an java runtime environment..which is used to run the class file generated by javac.exe..i.e., class file that is generated is an platform independent file...Now JVM will convert that class file into an platform dependant file...so to run a java program we need JVM.which implies JVM is compulsory inorder to run the java program. Without JDK_HOME... i mean jdk installed ..we cannot compile the java file