• Post Reply Bookmark Topic Watch Topic
  • New Topic

Just in Time compiler  RSS feed

 
vishal mishra
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Namaste Friends !!

Please explain me is there any command for compiling program using JIT compiler or JVM takes care of it?

I know my question is not to the point...actually....I want to know when user compile .java file using javac command, is the file compiles using JIT compiler or simple java compiler.

When JIT is used? How to use JIT ?

Can we use it explicitly by typing some command ?

I have searched through net but not find any good source...so please explain me...

Thanks
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JIT isn't for compiling source code, but for compiling machine code from the bytecode generated by javac.

More here: Just-in-time compilation.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16059
88
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
vishal mishra
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper de Jong wrote:
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.


Thanks for your valuable explanation
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!