• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Just in Time compiler

 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:)
 
reply
    Bookmark Topic Watch Topic
  • New Topic