ClassNotFoundException: watij.runtime.ie.IE

28 views
Skip to first unread message

computer guy

unread,
Jan 14, 2009, 11:19:07 AM1/14/09
to watij
I'm having trouble getting Watij running on my machine. I copied the
DLL to my System32 folder, and put the path to the JAR in my
CLASSPATH. I wrote a simple program to test it out:

import watij.runtime.ie.IE;
import static watij.finders.SymbolFactory.*;

public class GoogleTest {
public static void main(String[] args) {
IE ie = new IE();
try {
ie.start("http://www.google.com");
ie.textField(name,"q").set("Watij");
ie.button("Google Search").click();
} catch (Exception e) { System.out.println("An exception was
found"); }
}
}

It compiles fine, but when run, I get the following:

Exception in thread "main" java.lang.NoClassDefFoundError: watij/
runtime/ie/IE
at GoogleTest.main(GoogleTest.java:6)
Caused by: java.lang.ClassNotFoundException: watij.runtime.ie.IE
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 sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 1 more

Any ideas on what I'm doing wrong?

darrell

unread,
Jan 24, 2009, 12:08:26 PM1/24/09
to watij
Your classpath should contain the JAR file. For example, if the
watij.jar file is located at C:\watij_3.2.1\lib\watij.jar then you
need to put C:\watij_3.2.1\lib\watij.jar in your classpath. If you put
JUST C:\watij_3.2.1\lib it will look for C:\watij_3.2.1\lib\watij
\runtime\ie\IE.class and it will not look inside the jar file.
Reply all
Reply to author
Forward
0 new messages