gstackoverflow
gstackoverflow

Reputation: 37034

Does .class file contains information about compiler version?

I have class file. It is a result of compilation. Can I know the compiler version which was used for creation of this file?

As a result I want to know something like java 1.6.0_45

Upvotes: 0

Views: 100

Answers (2)

Varun Phadnis
Varun Phadnis

Reputation: 681

Yes, that information is part of class file. More information here.

Edit: I stand corrected. The compiler version is not part of the class file. I confused major and minor versions with compiler version. Still keeping the link since it provides useful information pertaining to the question.

Upvotes: -1

talex
talex

Reputation: 20455

No. Class file contains only format version which is not directly corresponds to compiler version.

PS: Class files mainly can be found inside jars. Jars often contains manifests. Manifest may contain compiler version.

PPS: See also here

Upvotes: 2

Related Questions