tags:

views:

2753

answers:

4

What language is Sun's JVM written in?

+5  A: 

C.

Sun's not a Java shop; it's a C shop. That's what Solaris is written in.

duffymo
It should be noted that nearly all the Java standard libraries however are written in Java.
cletus
Absolutely correct, of course, but the question was about the JVM itself.
duffymo
At a guess, the C source includes some ASM - conditionally compiled on certain mainstream architectures.
slim
slim
Still, a large part of the JVM is written in C. (Or, was when I last looked at it.)
Jonathan Leffler
slim: The interpreters are written in an assembly language-like way in C++ (the C++ generates machine code).
Tom Hawtin - tackline
Some of the libraries are written in C, some date back to before Java. Most of the libraries are Java. HotSpot is low-church C++, not C.
Tom Hawtin - tackline
Silly response. They were supposed to jump in the time machine and suggest Java for implementing Unix in 1970? They were supposed to rewrite their Solaris in Java? There have been a few Java OS's written, none targeting servers like Solaris does.
John M
+9  A: 

Strictly speaking, C++ (the JVM code does make use of C++ OO facilities).

Neil Coffey
the most logical answer, 100% agree with you
Registered User
+6  A: 

You can find out for yourself at: http://www.sun.com/software/opensource/java/.

Anthony Cuozzo
+12  A: 

Sun actually has multiple JVMs. The HotSpot JVM is written largely in C++, because HotSpot is heavily based on the Animorphic Smalltalk VM which is written in C++.

More interesting than HotSpot is IMHO the Maxine Research VM, which is written (almost) completely in Java.

Jörg W Mittag
"Low-church C++" would be a more accurate way of describing it.
Tom Hawtin - tackline
Maxine will be definitely such a great thing, when it'll be ready!
ivan_ivanovich_ivanoff
Well, it's a research project. By definition, it'll never be ready.
Jörg W Mittag