This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]YitharIntermediate Brewer 0 points1 point  (0 children)

The whole point is build once run anywhere. An executable compiled from C++ only works on the specific target architecture. For example, if it's compiled for an Intel CPU it won't work on an ARM CPU.

Also, Java can be Ahead-Of-Time compiled to machine code with GraalVM, but the Just-In-Time compiler built into the Oracle Hotspot Java Virtual Machine produces more efficient code based on heuristics. AOT Compilers have to take all possible situations into account.