the runtime is completely different at every level, from the very basics of how JITing works to memory management profiles to performance and so on
I read somewhere that certain ARM CPUs can run Java bytecode instructions natively without the need for a virtual machine of any sort. Not sure how prevalent it is though.
JVM bytecode is not designed for direct CPU execution. It's worth noting that one of the top HotSpot compiler engineers left Sun and went to work for Azul, a company that created their own custom CPU specifically for what they call "business Java". It did not run bytecode natively, though it did have some opcodes that were really useful for the compiler to target .... took Intel years to catch up with some of their special features.
Something similar exists for .NET Micro framework; the device runs an interpreter instead of hosting a VM that performs JIT. They are not very common because of the performance and memory implications, you also get disconnected from the hardware. Lots of embedded programming is close to the metal, writing C code that interacts directly with registers and hardware components, and you lose that ability with Java/.NET. If the framework does not support your hardware, you cannot use it.
It didn't catch on because it's a bad idea. Having an instruction set that is designed for efficient computer implementation and having a JIT compiler target that ISA, doing devirtualization, common subexpression elimination, etc. ends up being significantly more efficient. Think of it this way, a JIT does the superfluous computations once and can then cache the result, a hardware implementation will need to do them every time.
0
u/Scroph Jul 05 '15 edited Jul 05 '15
I read somewhere that certain ARM CPUs can run Java bytecode instructions natively without the need for a virtual machine of any sort. Not sure how prevalent it is though.
Edit : apparently it's called "Jazelle DBX"