title: Compiling and running JUnit in command line
body: <p>I have a project done in Java and we cannot use the IDE to compile it and run it, we are only allowed to use the command line. This project uses JSON. I have managed to successfully compiled and run it as follows:</p>
  <p>Compile: javac -cp ./lib/java-json.jar ./src/project/*.java</p>
  <p>Run: java -cp ./bin:./lib/java-json.jar project.Main</p>
  <p>Now my next step is to run a JUnit test in the command line. To compile I tried:</p>
  <p>javac [source files] -cp &quot;path-to-JUnit-jar-files&quot; path-to-JUnit-class</p>
  <p>which looks like this:</p>
  <p>javac ./src/project/<em>.java -cp &quot;./lib/JUnit/</em>.jar&quot; ./src/testing/AllTests.java</p>
  <p>This is the closest I have gotten to successfully compiling the unit test class (I think) because it gave me only a few errors in comparison to other commands I have tried. The errors it gave me are that it needs the classpath to the JSON jar file, but I don't know how to tell the command line to do that.</p>