// getting the CWD: Current Wording Directory // namely the current directory when java.exe was invoked. // It cannot be changed on the fly. String cwd = new File( '.' ).getCanonicalPath(); // Which may or may not be the same as: String userDir = System.getProperty( "user.dir" );You can of course spawn a script to a command shell that would be able change the CWD inside itself, but not for the spawning Java app.
You can fake a CWD by maintaining your own CWD variable and expanding all relative filenames to absolute yourself.
![]() |
and suggestions to improve this page to Roedy Green : | ||
| Canadian Mind Products | |||
| mindprod.com IP:[65.110.21.43] | |||
| Your face IP:[38.103.63.18] | The information on this page is for non-military use only. | ||
| You are visitor number 5,855. | Military use includes use by defence contractors. | ||
| You can get a fresh copy of this page from: | or possibly from your local J: drive (Java virtual drive/Mindprod website mirror) | ||
| http://mindprod.com/jgloss/cwd.html | J:\mindprod\jgloss\cwd.html | ||