Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do you name a Java package when it isn't a part of a top level domain?

Tags:

java

package

I've read the syntax conventions for naming Java packages, and I know the general rule of thumb, but what if you've just started building your application, you haven't chosen a license, and it is a personal project? It doesn't make sense to throw in "com.mycompany" or "org.myorganization" if that is not the case. Does anyone have suggestions for this?


2 Answers

Many Java books and online examples just use the name of the book or project, i.e., ejb3inaction.* or tutorial.*.

like image 78
Kaleb Brasee Avatar answered Oct 25 '25 06:10

Kaleb Brasee


I usually just go with something like lastname.firstname.<other packages>. The package name should just be unique, and the combination of your last name and first name is probably unique enough (if you have a common name, throw in a middle initial or a middle name or something like that).

like image 37
Thurstan Avatar answered Oct 25 '25 05:10

Thurstan