0

I want to add some jar files to my binary at runtime, but I keep getting errors. I'm running this on a Windows machine. My code is in a directory called SeleniumTest.

Here is the command I used to compile:

javac SeleniumTest\src\com\src\test\First.java -d SeleniumTest\bin -cp SeleniumTest\lib\junit-4.10.jar;SeleniumTest\lib\selenium-java-2.39.0.jar;SeleniumTest\lib\selenium-server-standalone-2.39.0.jar

This worked successfully. However when I try to run this command:

java -cp SeleniumTest\lib\junit-4.10.jar;SeleniumTest\lib\selenium-java-2.39.0.jar;SeleniumTest\lib\selenium-server-standalone-2.39.0.jar SeleniumTest\bin com.src.test.First

I get a message:

Error: Could not find or load main class SeleniumTest\bin

My code, First.java exists in

SeleniumTest\bin\com\src\test

What am I doing wrong?

tshepang
  • 12,111
  • 21
  • 91
  • 136
user1801060
  • 2,733
  • 6
  • 25
  • 44
  • Have you considered using [Gradle](http://www.gradle.org/), [Maven](http://maven.apache.org/) or [Ant](http://ant.apache.org/) / [Ivy](http://ant.apache.org/ivy/) to manage your build and dependencies? – lance-java Jan 31 '14 at 13:53

2 Answers2

1

try this

java -cp "SeleniumTest\lib\junit-4.10.jar;SeleniumTest\lib\selenium-java-2.39.0.jar;SeleniumTest\lib\selenium-server-standalone-2.39.0.jar;SeleniumTest\bin"  com.src.test.First
Isimon bev
  • 11
  • 1
0

try following

java -cp SeleniumTest\lib\junit-4.10.jar;SeleniumTest\lib\selenium-java-2.39.0.jar;SeleniumTest\lib\selenium-server-standalone-2.39.0.jar SeleniumTest\bin SeleniumTest\src\com\src\test\First
Satish
  • 391
  • 4
  • 22