我正在尝试使用Selenium JAR在Eclipse Luna中运行以下代码
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Hello_Class {
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
}
}
我正在
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/base/Function
at Hello_Class.main(Hello_Class.java:8) Caused by: java.lang.ClassNotFoundException: com.google.common.base.Function at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more
我添加了所有Selenium Jars: 1.selenium-Java的2.45.0.jar 2.selenium的Java-2.45.0-SRCS 3. Lib中的所有JARS
编辑1
设置类路径 - C:\ Program Files \ Java \ jre7 \ bin 我添加了尝试添加_selenium-server-standalone-2.45.0.jar和guava-18.0.jar
我已经安装了Eclipse Luna 64 Bit和Java 1.7.0_75 ..........
我仍然收到错误,不知道我现在还能尝试什么