I understand that the whole thing with the JVM is that you compile it once and you can run it anywhere with a JVM installation. But what's the point of that? Why not just compile the code multiple times, with different compilers for each OS?
Asked
Active
Viewed 44 times
0
-
To make life easier. I don't think it's a simple case of using a different compiler to compile any (say) C program for any OS. It's rarely that straightforward. – Steve Smith Sep 25 '17 at 08:03
-
Define “each OS”. Do you know all existing platforms? Is every developer supposed to know all of them? Or are users supposed to have “bad luck”, if there system is not an the list? – Holger Sep 25 '17 at 08:08
-
a) you need to have a machine running all platforms you want to support. b) it has to work on all those platforms despite being somewhat different. c) if a new processor comes along and you want to be able to support an old version for that new processor, you need to go back and build all the old versions. d) anyone using the libraries you have built needs to know how to select the optimal library at runtime (or install onto that machine) – Peter Lawrey Sep 28 '17 at 15:21