Studying for the oracle certification I am trying all the possible scenarios that might occur during the exam. For example, here there is a little doubt about shell command line (unix based):
Let's imagine there is a folder called myProject
and a sub folder called myProject/source.
File SubFile.java
is in the folder myProject/source
and another file File.java
is in myProject
folder.
By typing the following commands I get to different behaviors:
cd source
(therefore, currently I am on "myProject/source")
javac -sourcepath ../ File.java
// The command ../ does not work to access "Folder"
then after compiling File.java
from myProject
folder and returning to the sub Folder if I try:
javac -classpath ../ SubFile.java
// with the flag -classpath
it seems to accept the ../
syntax to access the super
folder.
Do you know why it works like this? and moreover is there any chance to access the super
folder with the -sourcepath
flag?