I'm missing something basic here. What's the use of compiling from a source language into bytecode (java) or intermediate language (.NET) and then running them from inside the JVM or CLR ?
There's the decrease in performance (however slight or large) of using managed code, but what are the benefits ? I know there's garbage collection and memory management but even so wouldn't it be better to just compile the source to native straight away without needing this intermediate level ?
Also (I'm adding this here since it's directly related to the question) - Apparently Windows 10 Universal apps are compiled with .NET Native which compiles to native machine code. I'm curious as to why this wasn't done before with all .NET programs.
Apart from everything else pointed out in the other answers, major benefits of this approach are the important cost reductions achieved in development and maintenance and the vastly improved scalability of the development environment.
Consider the case where there is no intermediate language; you would need to develop and mantain a compiler for each supported language and each supported platform. Say you have languages L1, L2 and L3 and platforms P1, P2 and P3. This would mean you'd need to develop and mantain 9 different compilers: C1(L1,P1), C2(L1, P2), C3(L1, P3), C4(L2, P1), etc.
On the other hand, having an intermediate common language I lets you develop 3 language specific compilers C1(L1, I), C2(L2, I) and C3(L3, I) and 3 platform specific compilers C4(I, P1), C5(I, P2) and C6(I, P3).
Evidently, the larger your supported language and platform base is, the more signifcant the cost reduction will be.
It also gives you a whole lot of flexibility in future additions of supported platforms or languages; any new language L4 will only require the development of one single compiler C(L4, I) and you inmediately support all platforms for the price of one development. Conversely, if you have a new platform P4, you will only need to develop C(I, P4) and, bingo, you have L1, L2 and L3 all working in P4.
It's basically a win win situation.