Question

this question may sound stupid but : in my source code i write this:

package validation;

and put my code in a folder named validation and then, when i want to make a jar file and install it in a local maven repository.Dose the name of the jar file matters? (i mean it should be the same as the package name {in this case validation} or i can use what ever name i want?

thanks a lot in advance.

Was it helpful?

Solution

You can use any valid file name for your jar. Package names are there to provide unique namespace to your classes so that there is minimal conflict between class files from different sources. But a jar file can have any user friendly name.

OTHER TIPS

the last part of the package name should match the folder name

For ex if you are in folder currentFolder your package should be a.b.c.currentFolder;

The name of the jar file does not mattern. The jvm loads the classfiles according to the package names, so you can call your jar anything

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top