aspose file tools*
The moose likes Beginning Java and the fly likes Java language Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java language" Watch "Java language" New topic
Author

Java language

rajesh sherla
Greenhorn

Joined: Apr 04, 2010
Posts: 11
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

Joined: Sep 29, 2008
Posts: 12617

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
Sheriff

Joined: Sep 28, 2004
Posts: 18896
    
  40


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


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14266
    
  21

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).

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
rajesh sherla
Greenhorn

Joined: Apr 04, 2010
Posts: 11
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

Joined: Aug 16, 2005
Posts: 14266
    
  21

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
 
subject: Java language