读取CLASS文件JDK版本
来源:互联网 发布:斗鱼刷人气软件那个好 编辑:程序博客网 时间:2024/05/20 16:36
读取CLASS文件JDK版本
package com.tool.classversion;import java.io.FileInputStream;/* * (magic):0xCAFEBABE// 5.0// (version):49.0// 6.0// (version):50.0// 1.4// (version):46.0// 1.3// (version):45.3 * */public class JavaVersionUtil {public static void main(String args[]) {String fileName = "PolicyInterfaceReqModel.class";printVersion(fileName);}public static void printVersion(String fileName) {try {FileInputStream fis = new FileInputStream(fileName);byte[] data = new byte[8];fis.read(data);fis.close();parseFile(data);} catch (Exception e) {System.out.println(e);}}private static void parseFile(byte[] data) {System.out.print("(magic):0x");System.out.print(Integer.toHexString(data[0]).substring(6).toUpperCase());System.out.print(Integer.toHexString(data[1]).substring(6).toUpperCase());System.out.print(Integer.toHexString(data[2]).substring(6).toUpperCase());System.out.println(Integer.toHexString(data[3]).substring(6).toUpperCase());int minor_version = (((int) data[4]) << 8) + data[5];int major_version = (((int) data[6]) << 8) + data[7];System.out.println("(version):" + major_version + "."+ minor_version);}}
- 读取CLASS文件JDK版本
- .class文件JDK版本
- class文件JDK版本查看
- 查看Class文件的JDK版本
- 查看class文件的编译jdk版本
- 如何确认class文件的jdk版本
- 从 class 文件看 jdk 版本
- 通过.class文件查看JDK版本
- 通过.class文件查看JDK版本
- 通过.class文件查看JDK版本
- 查看class文件的jdk版本
- 如何查看class文件的jdk版本
- 如何查看class文件的jdk版本
- class文件如何得知jdk编译版本
- 如何查看class文件的jdk版本
- JAVA类文件版本(class version)与JDK对应关系
- 如何查看Class文件编译的JDK版本
- CMD中查看CLASS文件编译的JDK版本
- 让Web API同时支持多个Get方法
- POJ 3358 凸包求面积
- 判别模型、生成模型与朴素贝叶斯方法
- android中的ellipsize
- UNIX网络编程——信号驱动式I/O
- 读取CLASS文件JDK版本
- C++ Templates FAQ
- base标签与a标签的href属性
- 去掉PowerDesigner生成SQL脚本中字段名带的引号
- 黑马程序员-AWT编程
- MySQL中select语句
- UVa 10055 Hashmat the brave warrior(勇士)
- java 父类子类静态成员,实例成员,构造函数初始化的顺序
- 多媒体函数简介