I tried this on mac:
touch ~/a.txt
And then java file:
import java.io.File;
public class testPwd {
public static void main(String [] args) {
File f = new File("~/a.txt");
System.out.println(f.exists());
}
}
It prints out "false".
Why is this? Does java recognize the "~" symbol? If I use absolute path, this f.exists() returns true.
Any explanations?