For some DOS commands you may need to use the cmd.exe or command.exe syntax:
also:
You can get the JAVA_HOME propery which will tell you where
java is installed.
String javahome = System.getProperties("java.home");
Then you can use reflection to find out the package that the class is in. Something like:
String thePackage = myObj.class.getPackage().toString();