Hello,
I'm comparing questions 11 and 12 and I do not understand the answers although they seem similar except the test subdirectory :
question 11: why question c is not correct ? The java command : java -classpath MyJar.jar GetJar is incorrect whereas question a : java GetJar is ok.
When compiling using javac -classpath MyJar.jar GetJar.java, the jar file was found... So does not it work with the java command the same way ?
Why the jar file is not found with java command ?
question 12 : I do not understand why the current directory has to be in the classpath to execute the java command ?
Indeed, in question 11, the java command did not need the current directory (.) to be set to run GetJar.java.
In this question, the right command has to include the (.) in the classpath in order to execute the GoDeep class.
If we compare both questions, it seems the mechanism is different...
I can't figure out why !
Someone could help me ?
I'm comparing questions 11 and 12 and I do not understand the answers although they seem similar except the test subdirectory :
question 11: why question c is not correct ? The java command : java -classpath MyJar.jar GetJar is incorrect whereas question a : java GetJar is ok.
When compiling using javac -classpath MyJar.jar GetJar.java, the jar file was found... So does not it work with the java command the same way ?
Why the jar file is not found with java command ?
question 12 : I do not understand why the current directory has to be in the classpath to execute the java command ?
Indeed, in question 11, the java command did not need the current directory (.) to be set to run GetJar.java.
In this question, the right command has to include the (.) in the classpath in order to execute the GoDeep class.
If we compare both questions, it seems the mechanism is different...
I can't figure out why !
Someone could help me ?