我正在尝试为 xquery 文档“安装”Saxon。
因此,我使用 saxon9he.jar 作为文件名设置了 Classpath var,并在 cmd saxon9he 中进行了尝试,但没有任何反应。所以我尝试通过以下方式执行 xquery 文件:
java net.sf.saxon.Query
我得到了:
C:\Users\Admin>java net.sf.saxon.Query
Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/saxon/Query
Caused by: java.lang.ClassNotFoundException: net.sf.saxon.Query
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: net.sf.saxon.Query. Program will exit.
我的配置有什么问题?
--更新1--
C:\Users\Admin\Desktop\Studium\5tes Semster\Semistrukturierte Daten\3 Übung>jav
a -cp saxon9he.jar net.sf.saxon.Query
No query file name
Saxon-HE 9.2.1.2J from Saxonica
Usage: java net.sf.saxon.Query [options] query {param=value}...
Options:
-backup:on|off Save updated documents before overwriting
-config:filename Use configuration file
-cr:classname Use specified CollectionURIResolver class
-dtd:on|off Validate using DTD
-expand:on|off Expand defaults defined in schema/DTD
-explain[:filename] Display compiled expression tree
-ext:[on|off] Allow|Disallow external Java functions
...
类路径变量似乎设置正确......