Java print time of last compilation -


i'm looking embed piece of code print out time when current class last compiled. how can implemented in java?

there no direct support in java, since there no preprocessor. closest equivalent "build-date" attribute in jar manifest. many build systems add attribute default, or provide means add it.

you can read manifest of jar @ runtime date. answer so question describes how read values jar manifest.

the alternative use resource filtering add date properties file, read @ runtime. quite ad-hoc, non-standard , if have many jars, different compilation times, becomes difficult manage, unless can factor common part of how jars built.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -