Re: Compile Date
- From: Mark Space <markspace@xxxxxxxxxxxxxx>
- Date: Wed, 30 Jul 2008 21:12:21 -0700
Zig wrote:
You should be able to get the lastmodified information for the .class file from the filesystem. A jar utility should preserve the modification date for each file in the archive. So:
public static Date getCompileTime(Class<?> cls) throws IOException
This seems to work from within NetBeans and as a seperate jar run from the command line.
$ java -jar GenericOverrideTest.jar
Found class genericoverridetest.Main at jar:file:/C:/Users/Dev/misc/GenericOverrideTest/dist/GenericOverrideTest.jar!/genericoverridetest/Main.class
Wed Jul 30 21:07:21 PDT 2008
init:
deps-jar:
compile:
run:
Found class genericoverridetest.Main at file:/C:/Users/Dev/misc/GenericOverrideTest/build/classes/genericoverridetest/Main.class
Wed Jul 30 21:07:21 PDT 2008
BUILD SUCCESSFUL (total time: 0 seconds)
Nice!
.
- References:
- Compile Date
- From: Roedy Green
- Re: Compile Date
- From: Zig
- Compile Date
- Prev by Date: Re: Student Project Idea
- Next by Date: Re: how many threads when jvm starts
- Previous by thread: Re: Compile Date
- Next by thread: Re: Compile Date
- Index(es):