Changing the current working directory in Java?
问题 How can I change the current working directory from within a Java program? Everything I\'ve been able to find about the issue claims that you simply can\'t do it, but I can\'t believe that that\'s really the case. I have a piece of code that opens a file using a hard-coded relative file path from the directory it\'s normally started in, and I just want to be able to use that code from within a different Java program without having to start it from within a particular directory. It seems like