编译成java字节码(不使用Java)

2023-10-15Java开发问题
6

本文介绍了编译成java字节码(不使用Java)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我的编译器类正在创建一种我们打算编译为 Java 字节码的语言.我们已经取得了很大进展,并且已经接近生成代码的时间了.

My compilers class is creating a language that we intend to compile to Java Bytecode. We have made plenty of progress and are nearing the time where it's time for code generation.

我们在查找有关如何从我们的编译器创建 .class 文件的信息时遇到问题.你有什么资源可以给我们一些帮助吗?我们已经有很多关于指令集的文档,但是需要关于如何直接填写类文件/十六进制编写的信息.

We are having problems locating information on how to create .class files from our compiler. Do you have any resources that can give us some assistance? We already have plenty of documentation on the instruction set, but need information on how to directly fill out the class file/the writing of hex.

我们不需要反编译 .class 文件的信息或建议.

We do not need information or suggestions on decompiling the .class files.

即使是从头开始写出 .class 文件的简单示例也非常棒.

Even a simple example of writing out a .class file from scratch would be excellent.

JVM 规范不是我们所追求的.我们真正需要的是示例或演练.

The JVM spec is not what we're after. What we really need is an example or a walkthrough.

推荐答案

VM 规范:类文件格式 和 Java 虚拟机指令集 应该这样做.

The VM Spec: The Class File Format and the The Java Virtual Machine Instruction Set should do it.

您可以查看字节码工程库 (BCEL) 以获得一些灵感以及 Findbugs(它必须阅读/理解类文件).

You might look at the Byte Code Engineering Library (BCEL) for some inspiration as well as Findbugs (it has to read/understand class files).

这篇关于编译成java字节码(不使用Java)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

如何使用 JAVA 向 COM PORT 发送数据?
How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)...
2024-08-25 Java开发问题
21

如何使报表页面方向更改为“rtl"?
How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)...
2024-08-25 Java开发问题
19

在 Eclipse 项目中使用西里尔文 .properties 文件
Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)...
2024-08-25 Java开发问题
18

有没有办法在 Java 中检测 RTL 语言?
Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)...
2024-08-25 Java开发问题
11

如何在 Java 中从 DB 加载资源包消息?
How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)...
2024-08-25 Java开发问题
13

如何更改 Java 中的默认语言环境设置以使其保持一致?
How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)...
2024-08-25 Java开发问题
13