Project

Profile

Help

Classpath Question

Added by Anonymous almost 17 years ago

Legacy ID: #4738904 Legacy Poster: pvallone (pvallone)

Hi, I am running saxon9002B Java and receiving the dreaded "Exemption in thread "main" java.lang.NoClassDefFoundError: net/sf/saxon/Transform" I added the classpath to the saxon9.jar to my windows XP environmental variables. I had this problem once before and it was solved when I added the classpath. Thanks,


Replies (6)

Please register to reply

RE: Classpath Question - Added by Anonymous almost 17 years ago

Legacy ID: #4738948 Legacy Poster: Michael Kay (mhkay)

It's quite hard for me to help with this problem because (despite what you're saying) you're not running Saxon; the Java VM can't find Saxon and that's a Java problem not a Saxon problem. There are a number of common causes, for example using "-jar" rather than "-cp" on the command line, misspelling the file name of the JAR file, getting the current directory wrong, and so on. Without knowing exactly what you typed and exactly what files are in which directories on your machine, it's impossible to say what you did wrong.

RE: Classpath Question - Added by Anonymous almost 17 years ago

Legacy ID: #4738966 Legacy Poster: pvallone (pvallone)

Hi, Thanks for the help. My saxon9 folder is C:\saxon9j which holds all the .jar files I set my CLASSPATH to ".;C:\saxon9j\saxon9.jar;" command line from my current directory c:\saxon9j: java net.sf.saxon.Transform -s:C:\temp\myXML.xml -xsl:C:\temp\xslt\myxslt.xsl -o:c:/temp/output.html Thanks for the help. pvallone

RE: Classpath Question - Added by Anonymous almost 17 years ago

Legacy ID: #4738974 Legacy Poster: Michael Kay (mhkay)

Does it work if you use the same classpath explicitly, viz java -cp .;C:\saxon9j\saxon9.jar net.sf.saxon.Transform -s:C:\temp\myXML.xml -xsl:C:\temp\xslt\myxslt.xsl -o:c:/temp/output.html If it does, then there's a problem with the setting of the environment variable.

RE: Classpath Question - Added by Anonymous almost 17 years ago

Legacy ID: #4738979 Legacy Poster: pvallone (pvallone)

Yes it does... Not liking windows right now. Thanks for the help pvallone

RE: Classpath Question - Added by Anonymous almost 17 years ago

Legacy ID: #4738984 Legacy Poster: Michael Kay (mhkay)

I tend to work on the assumption that changes to environment variables on Windows don't take effect until you reboot. This is almost certainly over-pessimistic, but I don't know what the actual rules are, and it errs on the safe side.

RE: Classpath Question - Added by Anonymous almost 17 years ago

Legacy ID: #4739029 Legacy Poster: pvallone (pvallone)

Once again, you are correct. Thanks again Sill Not liking windows....

    (1-6/6)

    Please register to reply