I always come across articles which claim that Java is interpreted. I know that Oracle’s HotSpot JRE provides just-in-time compilation, however is this the case for a majority of desktop users? For example, if I download Java via: http://www.java.com/en/download, will this include a JIT Compiler?
Share
Yes, absolutely. Articles claiming Java is interpreted are typically written by people who either don’t understand how Java works or don’t understand what interpreted means.
Having said that, HotSpot will interpret code sometimes – and that’s a good thing. There are definitely portions of any application (around startup, usually) which are only executed once. If you can interpret that faster than you can JIT compile it, why bother with the overhead? On the other hand, my experience of “Java is interpreted” articles is that this isn’t what they mean 🙂
EDIT: To take T. J. Crowder’s point in: yes, the JVM downloaded from java.com will be HotSpot. There are two different JITs for HotSpot, however – server and desktop. To sum up the differences in a single sentence, the desktop JIT is designed to start apps quickly, whereas the server JIT is more focused on high performance over time: server apps typically run for a very long time, so time spent optimising them really heavily pays off in the long run.