Ok, let's suppose you have the code distributed in files as follows
myproject
├── out
└── src
├── OwningAccessor.java
└── Owning.java
Go to your command prompt, and change directory to myproject
. Once there issue the following command:
javac -d out -sourcepath src src/OwningAccessor.java
I just tested it and it works just fine. Your compiled classes will be located in the out
folder:
.
├── out
│?? ├── OwningAccessor.class
│?? └── Owning.class
└── src
├── OwningAccessor.java
└── Owning.java
Compiling one class will trigger the compilation of all other dependent classes. The compiler will automatically look for them in the src
folder.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…