java 查看编译器版本_由java的class文件判断编译器版本

本文详细介绍了Java类文件的结构,包括magic number、minor_version和major_version等关键元素,以及它们如何定义类文件格式的版本。Java虚拟机实现需要支持特定范围的类文件格式版本,这确保了兼容性。
摘要由CSDN通过智能技术生成

}

}

> java ClassVersionChecker

ClassVersionChecker.class

ClassVersionChecker.class: 49 . 0

from The Java Virtual Machine Specification

magic

The magic item supplies the magic number identifying the class file

format; it has the value 0xCAFEBABE.

minor_version, major_version

The values of the minor_version and major_version items are the

minor and major version numbers of this class file.Together, a

major and a minor version number determine the version of the class

file format. If a class file has major version number M and minor

version number m, we denote the version of its class file format as

M.m. Thus, class file format versions may be ordered

lexicographically, for example, 1.5 < 2.0

< 2.1.

A Java virtual machine implementation can support a class file

format of version v if and only if v lies in some contiguous range

Mi.0 v Mj.m. Only Sun can specify what range of versions a Java

virtual machine implementation conforming to a certain release

level of the Java platform may support.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值