Make sure that your classpath and folder structure is right. It should look like this :
<root>
|
|- p1
| |
| |-Student.java
|
|- Test.java
so class Sudent is in p1 package and
Test is in default package (no package).
if you run
javac -cp . Test.java
from the root folder it should work.