You probably do not want to do such a thing. Is there a more high level of use case why you would get the date of a jar?

Usually depending on file dates would make you application very brittle, which would work on development, but when put into production, could lead hours of debugging, whit somebody screaming at the end.

On 9/19/23 07:38, Thomas Wolf wrote:
Hi,
My application has a bit of code that tries to do something based on the build 
date of the jar file.  To get the jar file, it does something like this:

        File jarFile = new 
File(Startup.class.getProtectionDomain().getCodeSource().getLocation().toURI());

This works fine when the application is run outside of NB, but when debugging 
inside NB, the File that gets pointed to is the 
$HOME/NetBeansProjects/myproject//build/classes/ directory.  Is there a way to 
config the NB project to use the jar file that it generates - i.e. 
$HOME/NetBeansProjects/myproject/dist/app.jar ?

Any info is much appreciated,
Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
For additional commands, e-mail: users-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
For additional commands, e-mail: users-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to