In a recent question asked recently my simple minded answer highlighted many of my misconceptions about Java, the JVM, and how the code gets compiled and run. This has created
Programming for the Java Virtual Machine is a good book for this topic. (Disclosure: I work with the author.)