How exactly do I run a .java TestNG project from a command line?
I have read through the TestNG documentation, and tried the following to no avail:
C:\projectfred> java org.testng.TestNG testng.xml
... with the following testng.xml file in my project:
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="SuiteAll" verbose="1">
<test name="TestAll">
<packages>
<package name="com.project.fred.tests"/>
</packages>
</test>
</suite>
The error I get is this:
Exception in thread "main" java.lang.NoClassDefFoundError: org/testng/TestNG
Caused by: java.lang.ClassNotFoundException: org.testng.TestNG
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)
Could not find the main class: org.testng.TestNG. Program will exit.
Obviously, I am not referencing TestNG correctly in my command line. Does anyone know how to get this working?