I have the classic :

java.lang.NoClassDefFoundError: org/python/util/jython

Even if the jar jython.jar exist in the environment variable PATH for my user and system wide path.

How can I quickly test that I am not crazy and it is indeed in the path?

有帮助吗?

解决方案

Java doesn't use the PATH variable.

To specify the classpath when running a java application use the -cp parameter for the java command.

Inside your batch file (the .cmd file) find the java command and add the needed jar file:

java -cp somefile.jar;\path\to\jython.jar someclass.MainMethod

Please don't use the deprecated CLASSPATH any more.

For more details, please see the Java documentation:
http://docs.oracle.com/javase/6/docs/technotes/tools/windows/classpath.html#tooloption

其他提示

use the following command

set classpath="path to your jar/jython.jar";
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top