I have this directory structure:
project1/src/edu/course/firstweek/javacourse/Program1.java
Another file in one package above:
Try going into one directory inside, i.e. cd src and then compile Javac edu/course/firstweek/program2.java
cd src
Javac edu/course/firstweek/program2.java
for running, do java edu.course.firstweek.program2
java edu.course.firstweek.program2