JUnit test can't find class in different folder
===

i'd like to run my tests from console so i wrote a small program(klasse.java):

    package nl.user;

    public class klasse {
	public static int sum(int a,int b){
	return a+b;	 
	 }
    }

and a test(mainTest.java):

    package nl.user.TestPackage;
    import static org.junit.Assert.*;
    import nl.nils.klasse;
    import org.junit.Test;

    public class mainTest2 {
	@Test
	public void test() {
		assertEquals(10, klasse.sum(7,3));
	    }
    }

everything works fine as long as both .class files are in the same folder. But in all my other programs my programs and tests are in different folders. As you see the program is in the ".../nl/user" direction and the test is in a subfolder ".../nl/user/TestPackage".

if i run the testfile with the following .bat file:

set CLASSPATH=,;%CLASSPATH%;C:\Users\myname\Downloads\eclipse-SDK-4.2-win32-x86_64\eclipse\plugins\org.junit_4.10.0.v4_10_0_v20120426-0900\junit.jar;C:\Users\myname\workspace\JUnitTest\bin\nl\user;C:\Users\myname\workspace\JUnitTest\bin\nl\user\TestPackage;C:\Users\nlagemann\workspace\JUnitTest\src\nl\user;C:\Users\nlagemann\workspace\JUnitTest\tests\nl\user\TestPackage

java org.junit.runner.JUnitCore mainTest2

pause

(yes, not all of the CLASSPATH is needed)

i get:

    Exception in thread "main" java.lang.NoClassDefFoundError: mainTest2 (wrong name
    : nl/user/TestPackage/mainTest2)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        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)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at org.junit.runner.JUnitCore.runMain(JUnitCore.java:89)
        at org.junit.runner.JUnitCore.runMainAndExit(JUnitCore.java:53)
        at org.junit.runner.JUnitCore.main(JUnitCore.java:45)

i think i have to do sth. with the CLASSPATH but i can't figuure out what :/