Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does it really mean when you say "This language runs on JVM"?

I have been hearing a lot lately regarding Scala, Clojure, etc which is supposed to run on JVM. Does this means that those languages are implementing the Java API underneath? What does it mean for a language to run under JVM?

Thanks.

like image 798
user_1357 Avatar asked Oct 05 '11 02:10

user_1357


People also ask

What is a JVM language?

A JVM language is any language with functionality that can be expressed in terms of a valid class file which can be hosted by the Java Virtual Machine. A class file contains Java Virtual Machine instructions (Java byte code) and a symbol table, as well as other ancillary information.

Which programming languages use JVM?

The JVM was initially designed to support only the programming language Java. However, as time passed, even more languages were adapted or designed to run on the Java platform.

Can JVM run programs which are written in other languages?

The JVM can "run" other programming languages because it can "run" any programming language, because it is Turing complete.

Why is JVM so popular?

One of the biggest reasons why Java is so popular is the platform independence. Programs can run on several different types of computer; as long as the computer has a Java Runtime Environment (JRE) installed, a Java program can run on it.


2 Answers

It means that these languages can be compiled into Java bytecode, which the JVM executes.

like image 95
Paul Bellora Avatar answered Sep 21 '22 02:09

Paul Bellora


It means that the language compiles down to JVM byte code at some point. The language doesn't need to implement the Java API; the Java API is already there (more or less all the time).

It just means if you have a JVM you should be able to run the language without another VM (although you'll need whatever class files the language compiler and libraries need, obviously).

like image 35
Dave Newton Avatar answered Sep 22 '22 02:09

Dave Newton