0

Is java a Just In Time compiler (JIT) or is java compiled by the programmer with javac. If both, whats the benefit of each?

1
  • The answer is 'both'. Commented Aug 9, 2016 at 5:57

1 Answer 1

-1

Java is compiled into Java Bytecodes. Those bytecodes are then interpreted by the Java Virtual Machine at runtime. So technically neither.

Sign up to request clarification or add additional context in comments.

7 Comments

JIT compilation != interpretation. The HotSpot JVM interprets bytecode at first and then JIT-compiles methods that are called a lot. Previous JVMs only interpreted the bytecode. In that case there'd be no JIT compilation going on.
Is the difference that the bytecode can't be modified while running?
The difference is that JIT compilation translates the bytecode to machine code (i.e. it compiles it) and then runs the machine code, whereas interpretation simply executes the bytecode without compiling anything.
How can it execute without translating it to something the processor can understand?
Something like if(instruction.isAdd()) { memory[instruction.target()] += instruction.argument(); } else if ...
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.