Almost every article I read told me that you can\'t have chdir in Java. The accepted answer to this question says you can\'t do it in Java.
However, here\'s s
Just because new File(".") gives the desired answer doesn't mean it's doing what you want it to.
For example, try:
new FileOutputStream("foo.txt").close();
Where does that end up? On my Windows box, even though new File(".").getAbsolutePath() moves around based on user.dir, foo.txt is always created in the original working directory. It strikes me that setting user.dir such that new File(".") doesn't refer to the current working directory is just asking for trouble.