Like the title says, I need to find the directory/path of a file. I know that the computer running the program has the file but I don't know the path/directory. The only thing I know about the file is its name(file.jar).
File f = new File("file.jar");
String ap = f.getAbsolutePath();
return ap;
I have already tried using getAbsolutePath() method and it didn't work so I was wondering if there was another way to get the directory/path of file.jar.