I\'m using eclipse, the jar files locate in ~/zmx/alg4/algs4.jar, the class file I need is algs4.jar/A.class. my project exists in ~/workspace/test. the jar fil
You can’t use classes in the default package from a named package: "[import] require a compile-time error on any attempt to import a type in an unnamed package". You may want to access it via reflection (see below), or repackage your library algs4.jar if you have the source code.
Class.forName("SomeClass").getMethod("someMethod").invoke(null);