Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java language

 
rajesh sherla
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to know in which programming language Java is written ??

Correct me if i am wrong for below findings :

JVM is written in ANSI C
javac is written in Java language.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no one language a JVM or Java compiler is written in--which one are you asking about?

And welcome to JavaRanch!
 
Henry Wong
author
Marshal
Pie
Posts: 20835
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Having worked for a company that licensed and shipped a variant of the JVM from Sun -- I can confirm that the JVM is mostly written in C++, with some written in C, and with some really really small parts in assembly.

Henry
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To make it more clear what David said: "Java" is only a specification. It's written in... English (see The Java Language Specification and The Java Virtual Machine Specification).

There are different implementations of the JVM: ofcourse Sun's JVM which probably most people use, but IBM and HP have their own implementations for their own hardware and software platforms, and there's for example also JRockit, a JVM originally written by BEA (which was bought by Oracle some time ago) optimized for Intel x86 hardware.

Maybe Sun's JVM was largely written in C or C++ with some assembler, but what the others have been written in is not publicly known.

Most of Sun's JVM is open source (see OpenJDK) so you can see the source code if you want to (you don't need any special license or permission to get the source code).
 
rajesh sherla
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK I agree whatever is said.

I know to write anything in Java, simple plain English is used.

But From one of the Sun vendor, they had given that JVM is written in ANSI C and javac(java compiler) is written in Java.

I clearly understand that JVM implementation is confidential. But what about java compiler.

Is there any Specification for Java compiler ??
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rajesh sherla wrote:I clearly understand that JVM implementation is confidential.

No it isn't, as I wrote. Sun's JVM implementation is almost completely open source, you can download the source code here: OpenJDK. That includes the source code of Sun's Java compiler, which is written in Java.

The Java compiler must follow the rules that are in the Java Language Specification.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic