Have you declared your SimpleTest class to be a member of the junitfaq package? If you have, you should be able to run it from the src directory like java junitfaq.SimpleTest
but you should get an error like this if you try to run it from within the junitfaq directory: Exception in thread "main" java.lang.NoClassDefFoundError: SimpleTest (wrong name: junitfaq/SimpleTest)
Make sure your SimpleTest class starts with package junitfaq;
Edit: Here's a working example incorporating the comments below.
login@domain:~/temp> mkdir src
login@domain:~/temp> cd src
login@domain:~/temp/src> mkdir junitfaq
login@domain:~/temp/src> nano junitfaq/SimpleTest.java
The contents of SimpleTest.java are as follows when I exit nano:
package junitfaq;
public class SimpleTest {
public static void main(String[] args) {
System.out.println("Test");
}
}
login@domain:~/temp/src> javac junitfaq/SimpleTest.java
login@domain:~/temp/src> java junitfaq.SimpleTest
Test