How to find out from *.class file with which Java version 1.6 or 1.5 it was compiled?

G

Gianni Galore

Assume I got a *.class file.

Is there a way to find out with which java version (e.g. 1.5upd14 or v1.6.upd20) this *.class
file was previously compiled?

Gianni
 
L

Lew

Gianni said:
Assume I got a *.class file.

Is there a way to find out with which java version (e.g. 1.5upd14 or v1.6.upd20) this *.class
file was previously compiled?

Cross-posting is not terrible, but usually it's enough to post your
query in one newsgroup or another without cross-posting. That's
especially true for comp.lang.java.programmer and comp.lang.java.help
which have substantially the same readership.

You did do the cross-post exactly correctly, mind you. No complaints
there. It just probably didn't do very much to help you.
 
C

ClassCastException

Cross-posting is not terrible, but usually it's enough to post your
query in one newsgroup or another without cross-posting. That's
especially true for comp.lang.java.programmer and comp.lang.java.help
which have substantially the same readership.

You did do the cross-post exactly correctly, mind you. No complaints
there. It just probably didn't do very much to help you.

That's absolutely fascinating, but it's also completely irrelevant as a
response to "Is there a way to find out with which java version (e.g.
1.5upd14 or v1.6.upd20) this *.class file was previously compiled?"

HTH.
 
L

Lew

That's absolutely fascinating, but it's also completely irrelevant as a
response to "Is there a way to find out with which java version (e.g.
1.5upd14 or v1.6.upd20) this *.class file was previously compiled?"

Wrong.
 
C

ClassCastException


No, not wrong. Your comments about cross-posting correctly do, indeed,
have ****-all to do with determining the version of Java used to compile
an in-hand .class file.
 
L

Lew

No, not wrong. Your comments about cross-posting correctly do, indeed,
have ****-all to do with determining the version of Java used to compile
an in-hand .class file.

You are mistaken.
 
C

ClassCastException

You are mistaken.

Simply repeating a claim after it's been disproved, without even
attempting to provide some actual evidence and some actual arguments to
support it, does not accomplish much.

It does, mind you, make you look like a small, petulant child, FWIW.
 
L

Lew

Your own post is similarly relevant as mine. Both of us sought to improve the
user's experience by pointing out some metainformation about the communication
channel. Neither of us answered the query directly, true, but both of us
wanted to increase the reach and power of the query, thus empowering it. By
pointing out with positive reinforcement that the OP had used cross-posting
correctly, albeit perhaps not usefully, I was providing meta-information that
will improve his results in all communications through the news group. By
pointing out what you perceive as off-purpose communication, you clearly hope
to reduce the signal-to-noise ratio thus helping relevant information stand
out more clearly. Bully for you.
 
C

ClassCastException

Your own post is similarly relevant as mine.

My post was relevant to the body text of the post it was directly
replying to. Yours was not.
Both of us sought to improve the user's experience by pointing out some
metainformation about the communication channel.

Q: How do I know which Java version compiled this class file?
A: something about crossposting

Yeah, real "improvement" to the user experience there. If the user's an
avid collector of non sequiturs, anyway.
Neither of us answered the query directly, true

You didn't answer it even indirectly. Your post said nothing at all about
versioning of class files. And whereas mine also didn't, mine was also
NOT a direct followup to the OP.
By pointing out with positive reinforcement that the OP had used cross-
posting correctly, albeit perhaps not usefully, I was providing meta-
information that will improve his results in all communications through
the news group.

I think it would have improved his results a lot more had your initial
followup contained an actual answer to his question.
By pointing out what you perceive as off-purpose communication, you
clearly hope to reduce the signal-to-noise ratio thus helping relevant
information stand out more clearly. Bully for you.

ITYM increase the signal-to-noise ratio.
 
L

Lew

ClassCastException said:
I think it would have improved his results a lot more had your initial
followup contained an actual answer to his question.

Have you been reading this thread? (That's a rhetorical question.) I not
only answered his question first, I was first to answer his question. My
comments about cross-posting were sent nearly an hour later. Here's what I said,
<http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html>
The first four bytes of the class file comprise the magic number
0xCAFEBABE (unsigned int).
The next two bytes comprise the minor version number of the class file
format (unsigned short).
The next two bytes comprise the major version number of the class file
format (unsigned short).

The major and minor versions tell you what version of Java can run the
class file, but not necessarily which version produced it. I don't
know of any way to get at the Java version that compiled it, but you
can live without that information anyway.

Class file formats do not change between minor Java version updates,
and not even necessarily between major Java version updates.

You should know that Java 5u14 and 6u20 lack certain critical bug and
security fixes and you should upgrade to the latest available versions
of those products, updates 22 and 21, respectively. (Java 5 has been
frozen for public use at update 22, having reached its end-of-service-
life on November 3, 2009, though paying customers can get more recent
updates. Yes, that's right, Java 5 has been officially obsolete for
nine months, a fact that your customers who are only just now
upgrading from their obsolete 8 1/2-year-old version to the obsolete
nearly-6-year-old version really should find out.)

You can find which major class file versions correspond to which Java
versions at
<http://mindprod.com/jgloss/javaclassformat.html>

Note that I answered in detail and provided links for further information.

The mindprod site cited is a good summary.
 
C

ClassCastException

Have you been reading this thread?

Yes -- every post of it.
I not only answered his question first, I was first to answer his
question. My comments about cross-posting were sent nearly an hour
later.

That's simply not true. This thread consists of:

<[email protected]> -- the OP
<961ea200-1357-4209-a484-8df420ad2c65@w30g2000yqw.googlegroups.com> --
your comments about crossposting
<[email protected]> -- me
<[email protected]> -- your reply to me
<[email protected]> -- back and forth...
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]> -- your latest post
and <[email protected]> -- Roedy attempting to
answer the question

That's it. Every post by you is either the cross-posting comment or a
descendant of that and none of them answer the OP's question. Eternal-
September currently has 11 posts of this thread -- about to become 12.

If you did post anything else to this thread, it failed to propagate.

I notice you make most of your posts through Albasani, but your initial
cross-post comment was posted via Google Groups. I suspect you'd resort
to Google Groups only if something was wrong with Albasani at the time.
Perhaps you attempted to post an actual answer to the OP's problem via
Albasani just as it developed technical difficulties, and Albasani
claimed the post was successful and perhaps did spool it locally but
failed to propagate it due to the precise timing of the fault?
 
L

Lew

Yes -- every post of it.

Apparently not, as your responses /infra/ show. Also, I pointed out that the
question was rhetorical. How interesting that you chose to answer anyway.
That's simply not true. This thread consists of:

It simply is true.

You're just being fractious to be a troll.
That's it. Every post by you is either the cross-posting comment or a

Wrong. I quoted the post in its entirety. I got that quote from Usenet, from
the post I put up on 8/4 at 15:33 Z. Did you read my quote? Your argument is
based on false premises. I conclude that you are just being argumentative.
descendant of that and none of them answer the OP's question. Eternal-

Except my first one, which for some reason you missed or suppressed.
September currently has 11 posts of this thread -- about to become 12.

I count 17 about to become 18 with this here post right here. You should get
your ISP straightened out.

Your count is waaaaay off. ASre you sure you
If you did post anything else to this thread, it failed to propagate.

How generous of you to allow, but it propagated just fine.
I notice you make most of your posts through Albasani, but your initial
cross-post comment was posted via Google Groups. I suspect you'd resort
to Google Groups only if something was wrong with Albasani at the time.
Perhaps you attempted to post an actual answer to the OP's problem via
Albasani just as it developed technical difficulties, and Albasani
claimed the post was successful and perhaps did spool it locally but
failed to propagate it due to the precise timing of the fault?

I still see my original post nearly two weeks later, both from Albasani and
from GG (the latter linked from this post).
 
L

Lars Enderin

Apparently not, as your responses /infra/ show. Also, I pointed out
that the question was rhetorical. How interesting that you chose to
answer anyway.



It simply is true.

You're just being fractious to be a troll.


Wrong. I quoted the post in its entirety. I got that quote from
Usenet, from the post I put up on 8/4 at 15:33 Z. Did you read my
quote? Your argument is based on false premises. I conclude that you
are just being argumentative.


Except my first one, which for some reason you missed or suppressed.


I count 17 about to become 18 with this here post right here. You
should get your ISP straightened out.

Your count is waaaaay off. ASre you sure you


How generous of you to allow, but it propagated just fine.
<http://groups.google.com/group/comp.lang.java.help/browse_thread/thread/c8afff58b21f093c#>

shows it, for example.


I still see my original post nearly two weeks later, both from Albasani
and from GG (the latter linked from this post).
For the record:
I see only 12 posts in this thread (in comp.lang.java.programmer). I
don't subscribe to comp.lang.java.help, and I don't see your first reply
to the OP. My ISP is albasani, and my news reader is Thunderbird 3.0.6
(Linux X86_64). It shows links to the rest of the thread. The links are
numbered 1-11. Number 2 is
<961ea200-1357-4209-a484-8df420ad2c65@w30g2000yqw.googlegroups.com>.
 
L

Lew

Lars said:
For the record:
I see only 12 posts in this thread (in comp.lang.java.programmer). I
don't subscribe to comp.lang.java.help, and I don't see your first reply
to the OP.

Then you are deliberately counting the wrong group.

Given that the OP posted with a followup to clj.help, that would be
where you would expect replies to appear and whence you would get the
authoritative and accurate count of posts. ClassCastException was
being just a tad disingenuous in discounting my reply simply because
it showed up exactly where the OP wanted.

This does illustrate the relevance of my comment about cross-posting.
People don't even know what was said in the conversation because of
it, for pity's sake.
 
C

ClassCastException

Apparently not, as your responses /infra/ show.

Apparently yes, since I just enumerated every single post to this thread
that Eternal-September has in its spool.
Also, I pointed out that the question was rhetorical. How interesting
that you chose to answer anyway.

Because you were drawing a wrong conclusion that needed to be corrected.
It simply is true.

It simply isn't. I listed off, citing message-IDs, every single post in
this thread at that time, and not one of them was by you and answering
the OP's question.

I don't know why you persist in claiming that there's an additional post
to this thread, given how easy it is to see that there is not.
You're just being fractious to be a troll.
Incorrect.


Wrong.

No, not wrong.
I quoted the post in its entirety.

What you "quoted" did not, apparently, actually exist in this thread
until you "quoted" it.
I got that quote from Usenet, from the post I put up on 8/4 at 15:33
Z.

You got that quote directly out of your butt, from what I can tell.
Certanly there is no post in this thread by you dated 8/4 15:33 Z. The
first post to this thread is by Gianni Galore dated 8/4 14:21 Z and the
second post to this thread is by you dated 8/4 16:27 Z. There's nothing
in between.
Did you read my quote?

Yes, not that it mattered since the post you were "quoting" doesn't exist.
Your argument is based on false premises.

No, yours is -- yours is predicated on the assumption that we'll just
believe in your phantom 15:33 post even when it doesn't actually appear
in this thread and all we have to support the notion that you even wrote
and *attempted* to send such a post is your self-serving word for it.
I conclude that you are just being argumentative.

That's funny, because from where I'm sitting it looks like *you* are just
being argumentative.
Except my first one, which for some reason you missed or suppressed.

I did neither. It does not exist, or, at the very least, Eternal-
September does not have it.
I count 17 about to become 18 with this here post right here.

Incorrect. At that time it was 12 about to become 13.
You should get your ISP straightened out.

I'm not using my ISP's news server. I'm using Eternal-September. It now
has 15 posts in this thread, about to become 16.
Your count is waaaaay off.

No, *your* count is waaaaay off.
ASre you sure you
What?


How generous of you to allow, but it propagated just fine.

Obviously not, or I'd have read it.

If, that is, you even posted it at all, for which (again) we have only
your word.
 
C

ClassCastException

Then you are deliberately counting the wrong group.

He -- and I -- are deliberately counting the group we are actually
reading and not some other group.
Given that the OP posted with a followup to clj.help,

He did? That's news to me. But then, it's not visible when just casually
reading the post, and since I didn't know how to answer the OP's
question, I never hit 'f' while reading it.
ClassCastException was being just a tad disingenuous in discounting my
reply simply because it showed up exactly where the OP wanted.

That statement is incorrect in multiple ways. I discounted your reply
because it did not show up at all, at least not that I ever saw. In fact
this is the first you've claimed to have posted it only to cljh and not
to cljp. Since your reply that I did see was posted to both, there was no
logical reason why any hypothetical other post of yours wouldn't also
have been.
This does illustrate the relevance of my comment about cross-posting.
People don't even know what was said in the conversation because of it,
for pity's sake.

Funnily enough, your usual complaint is that *multi*posting will result
in such confusion. Apparently so will crossposting if you drop some
groups from followups, and especially if you do so from *some* followups
and not others. Indeed, you made statements about your past posts that
are apparently true if read in comp.lang.java.help and false if read in
comp.lang.java.programmer! The statements in question should either have
been rephrased or posted only to cljh to avoid their being untrue in some
of the contexts in which they'd be read.
 
C

ClassCastException


No, not wrong.
You deliberately clipped the line from my post just after "it
propagated just fine":
thread/c8afff58b21f093c#>

I clipped that line because it's irrelevant. The topic of our discussion
was THIS thread, in comp.lang.java.PROGRAMMER. You linked to a thread in
comp.lang.java.HELP, a group I don't even read. Obviously anything you
posted (solely) there I won't have seen, nor will lots of other people.
which shows that you are a troll and a bounder.

I'm not the one who has resorted to namecalling and similarly childish
antics in this dispute.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top