Ever heard about the Oracle Java Compatibility Kit (JCK) which keeps code/compilation and behaviour in synch. OpenJDK and Oracle follw that also other vendors do that (apart from that OpenJDK is by Oracle) ... In earlier days there had been issues based on incompatibilites for example between IBM J9 and Oracle JDK (at the times of JDK5/6) etc. but those times are long over......
Really ? You blame the JVM or the Java Compiler NOT to magically cure OS dependent code ?
Keyboard code sequences are completely OS dependent (different between Linux, Windows, Mac OS, iOS, Android etc.) ...
A very "simple" example is the difference between file systems between Windows, Linux, Mac OS etc. .. The JVM (or more accurately the Java Language) has a very good abstraction which is Path etc. (NOT File!!) ..which is mapped via the JVM down to the OS level..
A very basic example is the usage of "\n" ? Which is interpreted different on different OS'es... ? There is simple solutions to handle that correctly ... System.lineSeperator()...
Apart from that I would suggest to stop that discussion because that does not help the original poster... If you like to dicuss about that topic open a different thread...
Kind regards.
Karl Heinz Marbaise