This time I've followed Junit Getting Started link, and the example works.
Below are the steps that I did in Windows;
1 : I created the folder test on my Desktop
2 : Inside test , I create the Calculator(Calculator.java) file
public class Calculator {
public int evaluate(String expression) {
int sum = 0;
for (String summand: expression.split("\\+"))
sum += Integer.valueOf(summand);
return sum;
}
}
3. Inside test , I created the CalculatorTest(CalculatorTest.java) file
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class CalculatorTest {
@Test
public void evaluatesExpression() {
Calculator calculator = new Calculator();
int sum = calculator.evaluate("1+2+3");
assertEquals(6, sum);
}
}
4: I downloaded Junit 12 jar from Maven Repository(Note : this example do not use maven, I use only maven repository to get the jar file).
5: I downloaded hamcrest-core 1.3 jar from Maven repository (Note : this example do not use maven, I use only maven repository to get the jar file)
6: The test folder looks like this

7: I opend the CMD and go to root of test folder and execute this command
javac -cp junit-4.12.jar;hamcrest-core-1.3.jar *.java
Note: *.java compiles all the files with java extension, in this case CalculatorTest.java and Calculator.java
8: The test folder looks like now like this

9: I executed the command
java -cp junit-4.12.jar;hamcrest-core-1.3.jar;. org.junit.runner.JUnitCore CalculatorTest
Note: this sentence must to add the dot(.) in the classpath, otherwise Calculator file is not find it and you will get
initializationError(org.junit.runner.JUnitCommandLineParseResult)
java.lang.IllegalArgumentException: Could not find class
And finally I get the unit test running by command line how you can see below

At this point the example does not inlcude the package keyword, which has to add the physical folders on Windows to running the test, lets explain this case
1: Let's add the package "stackoverflow.junit.test" to files Calculator.java and CalculatorTest.java
package stackoverflow.junit.test;
public class Calculator {
public int evaluate(String expression) {
int sum = 0;
for (String summand: expression.split("\\+"))
sum += Integer.valueOf(summand);
return sum;
}
}
and
package stackoverflow.junit.test;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class CalculatorTest {
@Test
public void evaluatesExpression() {
Calculator calculator = new Calculator();
int sum = calculator.evaluate("1+2+3");
assertEquals(6, sum);
}
}
2) now it is posible to compile the code with the same instruction show before javac -cp junit-4.12.jar;hamcrest-core-1.3.jar *.java
. However if I want to run the test I will get java.lang.NotClassDefFoundError

To solve this problem the folders had to been created physically and added the Calculator.java and CalculatorTest.java

With my right structure of folder I compiled and run the test, but having in account that this command are executed from test folder root on. What is more, the name of the package has to be add.
javac -cp junit-4.12.jar;hamcrest-core-1.3.jar stackoverflow/junit/test/*.java
java -cp junit-4.12.jar;hamcrest-core-1.3.jar;. org.junit.runner.JUnitCore stackoverflow.junit.test.CalculatorTest

Recommendation: All this will be less tedious if you use Maven or Gradle.
Recommendation: Check the structure of your proyect as well your CLASSPATH.