Bernard Bernard - 7 months ago 10
Java Question

How should I name packages if I don't have a domain associated with me?

So most Java resources when speaking of packages mention a

com.yourcompany.project
setup. However, I do not work for a company, and don't have a website. Are there any naming conventions that are common? An email address, perhaps?

Answer

Use a top-level domain like 'bernard' or something else unique. The important part is that the domain is unique so that you avoid clashes, and not that it starts with a real Internet top-level domain like org or com. E.g.

import java.util.*;
import bernard.myProject.*;
import org.apache.commons.lang.*;
Comments