1
votes

java -cp saxon9he.jar net.sf.saxon.Query only yields the following message:

could not find main class net.sf.saxon.Query

I have read in other threads that this is the proper command for XQuery mode in Saxon so what else could I be doing wrong?

2
Are you sure you're running the java command in the same directory that your saxon9he.jar is in? (Which it would have to be with that classpath.) See stackoverflow.com/questions/8997709/… for an example.Daniel Haley

2 Answers

2
votes

I'm a little surprised by this message, because normally when you get the classpath wrong, you get a quite different message: something like

Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/saxon/Query

It could be that you're using some command line tool which tries to make the message more friendly.

Anyway, from the information given, the most probable explanation is that saxon9he.jar does not exist in the current directory.

2
votes

Try to specify full path to your saxon9he.jar, for example, for me worked the following command when initially I had the same error, as you described:

java -cp "C:\SaxonHE9-7-0-5J\saxon9he.jar" net.sf.saxon.Query your-xquery-file.xq