Is it possible to load a class in Java and \'fake\' the package name/canonical name of a class? I tried doing this, the obvious way, but I get a \"class name doesn\'t match
Maybe it would be easier to move the API from the default package into a more reasonable spot? It sounds like you don't have access to the source code. I am not sure if the package is encoded into class files, so simply moving the API class might be worth a try. Otherwise, Java decompilers like JAD usually do a good job, so you could change the package name in the decompiled source and compile it again.