Under the root directory, there are two directories named src and classes.
I have two java files named Master and Slave.
Slave file is under the directory src/com/example/web and compiled master file is under the directory classes/com/example/model.
I have compiled the master class is used.
In Slave.java, Master class is used with the help of
import com.example.model.Master
But while compiling in the root directory using
javac -classpath classes -d classes src\com\example\web\Slave.java
the following error is thrown:
package com.example.model does not exist
if you know the Hierarchy of dependeny , you should build all classes based on dependency. in this case yous should execute this commands sequential :
first
then
if you have more than a class in packages you can build all with wild cards. for example: