Java编译器(javac)、虚拟机(JVM)和Java启动器是用哪种语言编写的?
当前回答
这个问题的精确措辞有点误导人:它不是“JVM”或“编译器”,因为有多个JVM供应商(jrockit是一个,IBM是另一个)和多个编译器。
The Sun JVM is written in C, although this need not be the case - the JVM as it runs on your machine is a platform-dependent executable and hence could have been originally written in any language. For example, the original IBM JVM was written in Smalltalk The Java libraries (java.lang, java.util etc, often referred to as the Java API) are themselves written in Java, although methods marked as native will have been written in C or C++. I believe that the Java compiler provided by Sun is also written in Java. (Although again, there are multiple compilers out there)
其他回答
Jikes RVM,一个广泛用于研究目的的自托管JVM,是用Java编写的。它不是人们在桌面上运行的那种,但它在我的“现在让我们展示一下这种语言的强大功能”列表中名列前茅。
假设您谈论的是Hotspot JVM,它是Sun提供的iirc,它是用c++编写的。有关Java的各种虚拟机的更多信息,可以查看这个链接。 javac,像大多数Java编译器一样,是用Java编写的。
一如既往的流行语言,用- C、c++编写。
原则上几乎任何事情,通常C
When Java was introduced by Sun Microsystem, the java compiler was written in C using some libraries from C++. As there is a concept in Compiler Design called Bootstrapping, Mostly it is used in Compiler Development, Bootstrapping is the process of writing a compiler(Or Assembler) In the source programming language which it is intended to compile. It is used to produce a self-hosting compiler. The development of compilers for new Programming languages first developed in an existing language and then rewritten in the new language and compiled by itself. That's why today, Java compiler is written in Java itself. Java Virtual Machine: Java virtual machine is an abstract machine. Like a real computing machine, It has an instruction set and manipulates various memory areas of runtime. Usually, JVM interprets the byte code into Machine code.
(有关更多信息,您可以查看此链接:https://docs.oracle.com/javase/specs/jvms/se7/html/)
推荐文章
- 如何分割逗号分隔的字符串?
- Java字符串—查看字符串是否只包含数字而不包含字母
- Mockito.any()传递带有泛型的接口
- 在IntelliJ 10.5中运行测试时,出现“NoSuchMethodError: org.hamcrest. matcher . descripbemismatch”
- 使用String.split()和多个分隔符
- Java数组有最大大小吗?
- 在Android中将字符串转换为Uri
- 从JSON生成Java类?
- 为什么java.util.Set没有get(int index)?
- Swing和AWT的区别是什么?
- 为什么Java流是一次性的?
- 四舍五入BigDecimal *总是*有两位小数点后
- 设计模式:工厂vs工厂方法vs抽象工厂
- Java:检查enum是否包含给定的字符串?
- 它的意思是:序列化类没有声明一个静态的最终serialVersionUID字段?