0

i downloaded watij and am trying to get it to run in eclipse. i tried this sample code

WebSpec spec = new WebSpec().safari(); spec.safari().open("http://www.google.com");

and WebSpec is underlined in red saying WebSpec cannot be resolved into a type I assume this means that something has not been added into my project.
I right clicked on my src folder and added the .jar files and then added webspec.jar to the project also

Are there any steps that I am missing?

Aaron
  • 53
  • 1
  • 7

1 Answers1

1

You don't put JAR files in your src folder. They are not source files.

Create a lib folder, put the JAR files there, and then add them to the project's build path.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • so if my project name is eclipse..do i right click on that and add the lib folder there with all the jar files? and then where does the webspec.jar file get added? – Aaron Apr 09 '11 at 07:12
  • @Aaron - yes. In fact, the folder could be called anything you like ... but "lib" is conventional. *"And then where does the webspec.jar file get added?"* - In the directory you just created ... of course. – Stephen C Apr 09 '11 at 07:24
  • ok so i did that and then added the folder to the build path but WebSpec is still recording a syntax error. Is there anything else I need to do? – Aaron Apr 09 '11 at 07:27
  • Is there an "import" statement in the class containing that code? (Basic Java 101 stuff ... though the getting started example on the watij.com site doesn't bother to mention it.) – Stephen C Apr 10 '11 at 05:48