jQuery in Action, 2nd edition*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes what does javac -d . Ankur.java mean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "what does javac -d . Ankur.java mean" Watch "what does javac -d . Ankur.java mean" New topic
Author

what does javac -d . Ankur.java mean

Ankur kothari
Ranch Hand

Joined: Sep 06, 2009
Posts: 531
Suppose i have

package test;
class Ankur
{
}

what does happen is that the class file goes in a new directory test which is created under the current working directory.

but can anyone explain what does -d and . actually mean?
Ankur kothari
Ranch Hand

Joined: Sep 06, 2009
Posts: 531
hey Ankur everyone here seems to be sleeping...let me help you.

In javac -d . Ankur.java, -d means the destination directory where the class file of Ankur.java will go.....if there is a package statement in your java file then the compiler will create the directory automatically for you

if Ankur.java was in another directory like test then you would say

In javac -d . test/Ankur.java

if in the current directory there is a directory called test1 and you want to store the class file there you would say

In javac -d ./test1 Ankur.java

if you say

In javac -d apple Ankur.java and In javac -d ./apple Ankur.java means the same....in the current directory

what do you do when you want to cd back to the previous directory....

you do ..

so javac -d ../apple Ankur.java will mean go back one directory and place the class file of Ankur.java in apple directory of that directory


hope this clears all your doubts....you owe me big time man


Ankur kothari
Ranch Hand

Joined: Sep 06, 2009
Posts: 531
thanks a lot Ankur....i love you man...i have one more doubt..is there any thing like ... or

javac -d .../apple Ankur.java

does the above sentence mean anything?
Ankur kothari
Ranch Hand

Joined: Sep 06, 2009
Posts: 531
i dont think there is anything like that

 
Consider Paul's rocket mass heater.
 
subject: what does javac -d . Ankur.java mean