I have a Java 8 application running on Windows. I would like to locate a file in my Java project without using the absolute path. The following code works when I run my application from a command prompt: System.getProperty("user.dir")
. However, when I run my java application from a batch file, this code return the path of the batch file, which is not the same as the path of the java application.
How do I get the path of file abc.txt that is located in a folder in my Java project?