1

Is there any way to set a constant to a value which depends on the time of compilation? I want my application to have a

public static final String RELEASE_DATE = "<???>";

similar to

#define RELEASE_DATE __DATE__

in C, which contains the date when the version was compiled. Of course I could change it manually everytime but there has to be a better way. Do Java and/or Eclipse give any possibilities to achieve that although Java does not have a preprocessor?

andrbrue
  • 721
  • 6
  • 15
  • Why do you want that to be hard-coded in the class file? Have you considered the manifest file or a properties file in META-INF? – ernest_k May 26 '18 at 11:46

0 Answers0