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.

有帮助吗?

解决方案

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.

其他提示

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top