I have created an application that uses selenium-server-standalone-2.47.1.jar
and javax.mail.jar
. The code works on eclipse, but I would like to run the same from command line. So I exported the project to a runnable jar file which contains both selenium and javax.mail.jar.
My code contains RTC.java
which has the Main function and another Ex.java
.
Both the class files are generated in com folder.
My App1.jar file is located in C:\installers.
I used the command:
c:\installers> java -cp App1.jar com.RTC
It says:
Exception in thread "main" java.lang.NoClassDefFoundError: org.openqa.selenium.WebDriver
Further I used:
java -cp .App1.jar com.RTC
Then it says could not find or load main class com.RTC.
What am I doing wrong?