I want to use my project dir to run the code when I wrote following command,
public static String userDir = System.getProperty("user.dir");
its returns me my Eclipse Dir path instead of my workspace path. I tried almost all the ways from here, but couldn't manage to solve the problem. I also tried
Path currentRelativePath = Paths.get("");
String s = currentRelativePath.toAbsolutePath().toString();
System.out.println("Current relative path is: " + s);
but it also display same result.