Re: Compile Date
- From: Eric Sosman <Eric.Sosman@xxxxxxx>
- Date: Wed, 30 Jul 2008 18:32:06 -0400
Roedy Green wrote:
Is the compile date of a class embedded in the class file somewhere? I
could see not putting it in to avoid false deltas when the code did
not really change.
The JVM Specification's description of the class file format doesn't
mention such a thing. However, a Java (or other) compiler can define
attributes beyond those mentioned in the JVMS, and a timestamp attribute
could be among the extras added. The JVM ignores attributes other than
the JVMS' set, so (1) such a timestamp wouldn't hurt anything, and (2)
its value would not be visible from inside the JVM after the class was
loaded.
It there a method to find out when a class was most recently compiled?
I suppose it could be handled with a script that generates a little
class containing today's date that gets freshly recompiled each day,
but that really just tells you when the jar was built.
You could hack javac to emit a "com.mindprod.CompileTime" attribute,
presumably as an attribute of the class itself (attributes also attach
to methods, fields, and so on). Or you could write a little utility to
add it to an already-compiled .class file -- but that really just tells
you when the utility was run, not when javac ran, so you'd need to be
diligent with your build scripts.
--
Eric.Sosman@xxxxxxx
.
- References:
- Compile Date
- From: Roedy Green
- Compile Date
- Prev by Date: Urgent opening for Brio/Hyperion developer with direct client in Milpitas, CA -6months contract
- Next by Date: Re: Logarithms in Java BigInteger
- Previous by thread: Re: Compile Date
- Next by thread: Re: Compile Date
- Index(es):
Relevant Pages
|