[英]error package org.python.util does not exist, compilation with ant
我正在尝试在Java中调用python方法,其功能与Unresolved import org.python /一起使用jython和Java?
但是,我正在使用ant来编译和运行文件。 使用import org.python.util
将给我这个错误
package org.python.util does not exist
我可以看到jython-2.5.0.jar中存在python.org.util。
因此,这是我的build.xml ant文件中包含的类路径:
classpath="${java.class.path}:./jgrapht/lib/jgrapht-jdk1.5.jar:\
./jgrapht/lib/jgraph.jar:./jgraphx/lib/jgraphx.jar:\
./jython/lib/jython-2.5.0.jar:./colt/lib/colt.jar:."
我也将jython jar文件的路径添加到了我的类路径中。 即看起来像echo $path
给了我所有必需的路径。 这里有我不知道的东西吗?
尝试执行以下操作以使包中的所有类均可用:
import org.python.util.*;
或这包括一个特定的类:
import org.python.util.TemplateAntTask;
编辑:而且,看起来在类路径中jython-2.5.0.jar之后还有一个额外的斜杠。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.