You should be outside the package directory and then execute the following command:

Java Code:
javac packagetest/ClassA.java
Once the class is compiled (.class file is generated), you can run the class using the following command:

Java Code:
java packagetest/ClassA