Eclipse中Java调用Python脚本
RCP模式下,用SWT做了个小界面;
给一个Button添加了监听,点击后调用Python脚本,callpython();
项目中导入了Jython.jar
编码时没出错;
public static void callpython(){
PythonInterpreter interpreter = new PythonInterpreter();
interpreter.execfile("D:\scripttest\test.py");
}
但在界面中点击按钮后,报出ClassNotFoundException;
而在另一个类里的主方法里写这两句调用,就可以执行,不报错;
忘大神们帮帮忙,看看怎么回事。
个人能力较弱,可笑之处还望见谅!