It is compiled to intermediate byte code but not machine code. You still need the JVM to JIT the byte code to something the CPU can deal with.
Re:JEP 295: Ahead-of-Time Compilation
by jsprogrammer on Thursday October 27, 2016 @03:20PM
(#12808749)
Not necessarily. Java byte code can be run directly on a JPM (Java Physical Machine).
Are there any that support the current class file format? ARM jazelle is no longer being worked on. So I would be surprised if there is anything that can do Java SE directly. JavaCard of course being quite different than standard Java.
Re:JEP 295: Ahead-of-Time Compilation
by imtringued on Friday October 28, 2016 @05:20AM
(#12814256)
Java bytecode is too highlevel for it to be suitable to run directly on hardware. Each instruction can map to multiple machine instructions. A JIT or AOT compiler can optimize the code on a lower level. A hardware implementation cannot do inlining, loop unrolling, hoist array length checks out of a loop, etc...
compile means "native code" here, not jvm bytecode.
Re:JEP 295: Ahead-of-Time Compilation
by brianwawok on Thursday October 27, 2016 @03:29PM
(#12808876)
Look at class file sometime. It is basically bad C code in appearance. It is nowhere close to assembly type code, which is what the final output of the JIT is.
Maybe I'm crazy, but the bytecode dumped from a class file definitely looks more like assembly than "bad C" to me, personally: https://gist.github.com/anonymous/e824444ea158beb7b72b26fbf1...
You give the JVM a .class file, not a .java file.
Though this is a technicality.
Java 9 will be able to compile java source code to java byte code then compile that java byte code to native machine code, correct?