我有以下java代码。我正在使用 XQJ 使用 XQJ api 编写一个测试 XQuery 程序。我已经下载了 JSR-000225 XQuery API for Java 1.0 Final Release,并将 xqjapi.jar 添加到我的类路径中。java代码简单如下
import javax.xml.xquery.XQConnection;
import javax.xml.xquery.XQDataSource;
import javax.xml.xquery.XQException;
public class SaxonExtJavaObject {
public static void main(String[] args) throws XQException, InstantiationException, IllegalAccessException, ClassNotFoundException {
XQDataSource xqds = (XQDataSource)
Class.forName("com.jsr225.xqj").newInstance();
// obtain a connection
XQConnection con = xqds.getConnection("usr", "passwd");
System.out.println("connected");
}
}
我的问题是我有以下异常
Exception in thread "main" java.lang.ClassNotFoundException: com.jsr225.xqj
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
请有人帮我解决这个问题。