Hacker News new | ask | show | jobs
by james-mcelwain 2540 days ago
We should be more precise: the JVM may or may not have an interpreter. This is implementation dependent. There are JVMs that are interpreted fully and AOT compilers as well.

Hotspot includes an interpreter -- your code may be interpreted until it gets hot and gets compiled.

Still, I don't think it's fair to call Java an interpreted language since the parts that are interpreted are only during warm up or slow enough not to matter.

1 comments

Yes you are right. Someone could argue Java Byte Code is interpreted, but I think colloquially, that's leading people to misunderstand the nature of modern JVMs, which as you say, will choose to either run the code in an interpreted manner, or compile it first (possibly with optimizations) dynamically at runtime. Those choices are made based on what will result in best performance and safety.

Java on the other hand is 100% compiled (to bytecode). And byte code is machine code for a non existent machine. Actually, I think Sun had built machines that could natively execute Java Byte Code. Someone could build an interpreter for it, but I'm not aware of one.