如何查看class文件编译的jdk版本
展开全部
在jar包中,用winrar解压一个类文件,然后在命令行下面输入
javap -verbose classname
会输出一些信息,大致如下:
Compiled from "HtmlCrawer.java"
public class org.eagleeye.html.HtmlCrawer extends java.lang.Object
SourceFile: "HtmlCrawer.java"
minor version: 0
major version: 50
Constant pool:
const #1 = class #2; // org/eagleeye/html/HtmlCrawer
const #2 = Asciz org/eagleeye/html/HtmlCrawer;
const #3 = class #4; // java.lang/Object
const #4 = Asciz java.lang/Object;
const #5 = Asciz client;
....
后面省略了,可以看到前面有两行:
minor version: 0
major version: 50
表示了类文件的版本
javap -verbose classname
会输出一些信息,大致如下:
Compiled from "HtmlCrawer.java"
public class org.eagleeye.html.HtmlCrawer extends java.lang.Object
SourceFile: "HtmlCrawer.java"
minor version: 0
major version: 50
Constant pool:
const #1 = class #2; // org/eagleeye/html/HtmlCrawer
const #2 = Asciz org/eagleeye/html/HtmlCrawer;
const #3 = class #4; // java.lang/Object
const #4 = Asciz java.lang/Object;
const #5 = Asciz client;
....
后面省略了,可以看到前面有两行:
minor version: 0
major version: 50
表示了类文件的版本
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询