Java Get Package Name of a Class using Apache Commons Lang This Java tutorial shows you how to get the package name of a Java class using the ClassUtils utility class of Apache Commons Lang library.