Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can we implement a java interpreter in hardware that executes Java bytecodes natively?

if we implement java interpreter in hardware then how we can achieve architecture neutrality of java bytecode... does java uses JIT(just in time interpreter) ? and how all this is related to Virtual Machine concept of operating system and java virtual machine(JVM)

like image 494
paragjain Avatar asked Sep 05 '09 18:09

paragjain


People also ask

Can Java bytecodes execute on their own?

No. Machine language can only be run on its its intended processor. Java bytecodes can only be run directly (ie. run without further effort) on a Java processor chip.

Does JVM execute native code?

Therefore, to be able to execute compiled java programs on real machines we need to "convert" them into an executable representation, that is machine code (the same thing as native code). By default, the JVM acts as an interpreter: that means the . class files are read and executed one bytecode (opcode) at a time.

What development tool do you use to launch Java bytecodes?

JDK, JRE, JVMJava Runtime Environment is a set of software tools needed to launch a compiled Java program. It includes Java Virtual Machine and Java Class Library. JVM is a program responsible for the execution of a bytecode. The first advantage of the JVM is a so-called 'Write once, run anywhere' rule.

Is the interpreter for Java bytecode?

As the Java compiler compiles the source code into the Java bytecode. In the same way, the Java interpreter converts or translates the bytecode into the machine-understandable format i.e. machine code, after that the machine code interacts with the operating system.


2 Answers

There has already been several hardware implementations of the Java system (i.e. a CPU that can execute bytecodes) but they have not become mainstream. This is most likely because that software implementations perform as well or even better as CPU's have become faster and faster.

As you will find when investigating more thouroughly, the details of the JVM implementations are not that important (and vary quite a bit) but they all execute the machine language of the JVM - java byte code. If you stay within the Java world and do not link in "native" stuff, you should be fine with whatever implementation you choose.

This company makes a living of providing server systems tuned for Java programs, they might interest you: http://www.azulsystems.com/

like image 151
Thorbjørn Ravn Andersen Avatar answered Nov 04 '22 21:11

Thorbjørn Ravn Andersen


Yes, there are several hardware Java implementations. However, they don't always perform better than software running on more general-purpose silicon.

Mark Lam has written several interesting blogs entries on this subject.

like image 41
erickson Avatar answered Nov 04 '22 21:11

erickson