Two Laptop Bag*
The moose likes Java in General and the fly likes  Version of a class !! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark " Version of a class !!" Watch " Version of a class !!" New topic
Author

Version of a class !!

P Srini
Greenhorn

Joined: Apr 23, 2009
Posts: 10
Hi All,

I have a question about .class files.
Let us assume that we have a Temp.class file which we got by compiling Temp.java using some X version of java.
Now!! Is there any way to know, which version of jdk was used to compile this class?

Regards,
Srinivas.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39395
    
  28
Try searching. This is one of the things which you would find.
P Srini
Greenhorn

Joined: Apr 23, 2009
Posts: 10

Thanks a Lot Campbell !!

Regards,
Srinivas.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
No, that is impossible. What Campbell points to lets you find out which Java version the class is compiled *for*. But you can't determine which Java version was used to do the compiling.


Ping & DNS - my free Android networking tools app
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39395
    
  28
Yes, Ulf you are correct; I misunderstood the question.
P Srini
Greenhorn

Joined: Apr 23, 2009
Posts: 10
So what is the correct answer for this? Is it possible to get this information?
Pushkar Choudhary
Rancher

Joined: May 21, 2006
Posts: 425

P Srini wrote:So what is the correct answer for this? Is it possible to get this information?

Ulf has already answered your question:

Ulf Dittmer wrote:you can't determine which Java version was used to do the compiling
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Version of a class !!