Ask HN:JVM 是如何工作的?我正在开发类似的虚拟化技术

1作者: Hashex1295427 个月前
我的公司被分配了一项任务,开发一个通用虚拟机,类似于 JVM,用于运行我们自己的自定义字节码和脚本。我了解 JVM 的内部工作原理,但我不明白: * 在 macOS 上,一个入口 `.class` 文件是如何被识别为一个独立应用程序并拥有单独的文档图标的? * 这些 class 文件如何与 Java 运行时环境通信? PS:起初,我曾考虑开发一个类似操作系统的环境,这意味着虚拟机将字节码视为文档,并拥有自己的文档、应用程序库以及安装/卸载系统。
查看原文
My company has been assigned the task of developing a general-purpose virtual machine, similar to the JVM, to run our own custom bytecode and scripts. I understand how the JVM works internally, but I don’t understand<p>How a entry `.class` file is recognized as a unique application on macOS and having separate doc icon? How the class files communicates Java Runtime Environment?<p>PS: First I thought to develop a complete new OS like environment, means the VM considers the byte code as document &amp; it&#x27;ll have own doc, application gallery, install&#x2F;uninstall system.