it seems the AntClassLoader does not correctly resolve the package name for a class not loaded via the bootclasspath. the particular case i am running involes a JUnit test case which attempts to strip off the package name by doing: Class oink = moo.cow.Piggy.class; String oinkClassName = oink.getName(); String oinkPackageName = oink.getPackage().getName(); String classNameNoPackage = oinkClassName.substring(oinkPackageName + 1); oink.getPackage() will return null. the workaround is to have junit fork the jvm. the forked jvm will return an appropriate package name. the JVM i'm running is JDK 1.3.1 (build 1.3.1-b24) on solaris 2.8
Fixed - the package information should now be available for non-forked <java> usage.