Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Does "current directory" refer to where I run the command `javac`?

the java doc says

The default value of the class path is ".", meaning that only the current directory is searched. Specifying either the CLASSPATH variable or the -cp command line switch overrides this value.

Does "current directory" refer to where I run the command javac?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

For example, I sign in my Windows with the account ubuntu, so the command prompt starts at C:\Users\ubuntu. And then I run the command
C:\programs\java\jdk8\bin\javac D:\soucecode\Hello.java. In this situation, does current directory refer to C:\Users\ubuntu\ or D:\soucecode\?

>Solution :

Current directory is the directory where you run your command.
Since you ran your command (javac) in C:\Users\ubuntu it will be the directory.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading