vishal mishra wrote:I want to know when user compile .java file using javac command, is the file compiles using JIT compiler or simple java compiler.
javac compiles Java source code to Java bytecode. That does not have anything to do with the JIT compiler.
vishal mishra wrote:When JIT is used? How to use JIT ?
The JIT compiler is automatically used by the JVM when your program runs; it converts Java bytecode to native machine code, as the program runs.
vishal mishra wrote:Can we use it explicitly by typing some command ?
No. There is an option to switch JIT compilation off (
-Xint), you use this when you run your program with the
java command (not when compiling your program). Your program will run a lot slower if you do this. This option only exists for debugging, normally
you should not use it.