문제

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