为什么你必须为 Windows & 编写单独的程序?Linux [英] Why do you have to write separate Programs for Windows & Linux

查看:21
本文介绍了为什么你必须为 Windows & 编写单独的程序?Linux的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在想,为什么有些语言(例如 Java)只需对代码进行很少或根本没有修改就可以在两种 Linux 上运行,而其他语言则几乎必须重新编写所有代码.为什么是这样?因为内核?

I've been wondering why do some languages, such as Java run on Both Linux with little or no modification of the code, but other languages you have to nearly re-write all the code. Why is this? Because of the Kernel?

对不起,如果这是一个简单的问题,但是,我真的没有太多线索.

Sorry if this is a simple question but, I really don't have much of a clue.

另外,就 Linux 而言,cpu 架构之间有什么区别.

Also, what's the difference between cpu architecture in terms of Linux.

推荐答案

从技术上讲,你错了.

Java 不能在 Linux 上运行.它也不能在 Windows 上运行.它也不能在 Mac 上运行,也不能在任何其他类似 Unix 的操作系统上运行.就此而言,它不在任何操作系统上运行.

Java does not run on Linux. It also does not run on Windows. It does not run on Mac either, nor any other Unix like operating system. For that matter, it does not run on any operating system.

它直接在机器上运行.它只适用于一种类型的机器——Java 虚拟机.幸运的是,Java 虚拟机已经虚拟化到 Linux、Windows、Mac 等平台上.

It runs directly on the machine. It only works on one type of machine - the Java Virtual Machine. Fortunately, the Java Virtual Machine has been virtualized onto Linux, Windows, Mac, etc.

这篇关于为什么你必须为 Windows & 编写单独的程序?Linux的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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