考虑到Java(该语言)是独立于平台的,为什么JVM不是独立于平台的? [英] Why is the JVM not platform independent, given that Java (the language) is platform independent?

查看:239
本文介绍了考虑到Java(该语言)是独立于平台的,为什么JVM不是独立于平台的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是想知道java何时与平台无关,那么JVM是否依赖平台有任何具体原因..

Just curious to know when java is made platform independent then are there any specific reasons JVM is made platform dependent..

推荐答案

除非你有一个可以直接执行Java字节码的CPU(有这样的东西),你需要能够与操作系统交互(例如读取文件,连接到网络,显示到屏幕等等) 。

Unless you have a CPU that can directly execute Java bytecode (there are such things) you need to be able to interact with the OS (for things like reading files, connecting to the network, displaying to the screen, etc...).

您可以用其他语言编写JVM(例如 Java JavaScript )但最终需要有可以与之交互的内容底层操作系统。

You can write a JVM in other languages (such as Java or JavaScript) but ultimately there needs to be something that can interact with the underlying OS.

这篇关于考虑到Java(该语言)是独立于平台的,为什么JVM不是独立于平台的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆