I\'m having the following problem when trying to get the path of a given resource:
System.out.println(\"nf=\"+new File(\".\").getAbsolutePath());
I'm adding Mr_Thorynque comment as an answer as it also works and at least for me seems to be simpler.
this.getClass().getResource(".").toURI().getPath()