How does javac -d work? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

How does javac -d work?

15th Mar 2018, 8:31 AM
Satyam Joshi
Satyam Joshi - avatar
2 Answers
+ 2
I've got it. So basically javac -d "path" "file-name.java" is used to create the "file-name.class" file in the destination location as give in "path". ex- if a file "A.java" is located in "C: " and you want to create the "A.class" in another location , say "D:/MyFolder" , you simply use this command inside "C:". javac -d D:/MyFolder A.java , this will create the A.class file in D: MyFolder
15th Mar 2018, 11:51 AM
Satyam Joshi
Satyam Joshi - avatar
+ 1
According to Oracle documentation , javac -d sets the destination directory for class files. does it have any other use?
15th Mar 2018, 9:09 AM
Satyam Joshi
Satyam Joshi - avatar