我正在尝试从https://jemmy.java.net/tutorial.html启动 jemmy 示例,并继续获取ClassNotFoundExeption
关于测试类的内容,即 org.netbeans.jemmy.Test.main(String params)
. 例如,与
enter code here
import org.netbeans.jemmy.*;
import org.netbeans.jemmy.explorer.*;
import org.netbeans.jemmy.operators.*;
public class WaitWindowSample implements Scenario {
public int runIt(Object param) {
try { //start application
new ClassReference("org.netbeans.jemmy.explorer.GUIBrowser").startApplication();
//wait frame
new JFrameOperator("GUI Browser");
} catch (Exception e) {
e.printStackTrace();
return (1);
}
return (0);
}
public static void main(String[] argv) {
String[] params = {"WaitWindowSample"};
org.netbeans.jemmy.Test.main(params);
}
}
我得到:
> Class WaitWindowSample does not exist!
java.lang.ClassNotFoundException: WaitWindowSample
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
我有一个普通的 Netbeans (ant) 项目并将 jemmy2.jar 添加到项目库中。有什么问题?