My app is a straightforward Java SE 6 program, built in Eclipse and distributed as a single executable jar (I don't need or use any advanced build tools such as ant).
I want to automate the process of getting accurate version information into the "About" message, because right now I have to remember to open the main class and update a version String every time I rebuild the app.
Ideally I'd like to automatically insert the date/time when the code (or the jar) was built into something I can access at runtime, but any workable approach would do.
Question
JamesCherrill
My app is a straightforward Java SE 6 program, built in Eclipse and distributed as a single executable jar (I don't need or use any advanced build tools such as ant).
I want to automate the process of getting accurate version information into the "About" message, because right now I have to remember to open the main class and update a version String every time I rebuild the app.
Ideally I'd like to automatically insert the date/time when the code (or the jar) was built into something I can access at runtime, but any workable approach would do.
Does anyone have any suggestions?
Thanks
James
Link to comment
https://www.neowin.net/forum/topic/746508-javaaccessing-build-datetime-at-runtime/Share on other sites
8 answers to this question
Recommended Posts