[code]System.getProperty("user.dir")[/code]
[code]public class GetPath {
public static void main(String[] args) {
GetPath test = new GetPath();
System.out.println(test.getPath());
}
public String getPath(){
return this.getClass().getResource("/").getPath();
}
}[/code]
[code]File f = new File(".");
f.getCanonicalPath();[/code]
[code]public class GetPath {
public static void main(String[] args) {
GetPath test = new GetPath();
System.out.println(test.getPath());
}
public String getPath(){
return this.getClass().getResource("/").getPath();
}
}[/code]
[code]File f = new File(".");
f.getCanonicalPath();[/code]