I installed a new hard drive with JDK 1.6.0_20 and Netbeans 6.9.1. I copied an existing Netbeans project from the old drive and imported it into NB 6.9.1.
Now it is suddenly creating output files and writing Log4J .log files in the c:\windows directory instead of the project directory.
I created the test class below outside of NB to see what is happening. Running this outside of NB gives the expected results. Importing this class into a new NB project also gives the expected results. But if I copy this class into the other project then it gives c:\windows for all 3 outputs.
What could be the problem with this one project that causes it to act like it's project directory is c:\windows?
public class DirectoryTest {
public static void main(String[] args) {
String userDir = System.getProperty("user.dir");
System.out.println(userDir);
File file = new File(".");
try {
System.out.println(file.getCanonicalPath());
System.out.println(file.getAbsolutePath());
} catch (Exception ex) {
ex.printStackTrace();
}
}
}