Search code examples
javanetbeansjarnetbeans-8

How to customize .jar file name


How can I customize the name of the built jar file? I want its name to be other than the default value which is the project name. I don't want to change the project name. Let's say for example i want the jar file name to be (today's date_name).jar


Solution

  • When using NetBeans with default JAVA ANT Project, you can edit project.properties file in nbproject-folder.

    search for (and change):
    dist.jar=${dist.dir}/MyNewFancyJARName.jar

    NOTE:
    Your changes may be lost/overriden, when you change project-settings via NetBeans-GUI (because it may generate a new properties file).

    NOTE 2:
    Maybe there is another way to make this change more persistent.
    Look for private.properties in folder: nbproject/private

    Cheers!