2 years ago

#28810

test-img

MelliChevallier

Relative Path not for a File but for a Working directory JAVA JAR Runnable

I have to set a currentDirectory for a FileReader with a relative path. It worked fine as long as I ran the application in Eclipse, but in the Runnable JAR file it doesn't. I also use Icons and was able to fix this problem there with the getClass().getResource, but that doesn't work with the FileReader. How can I fix this relative path for the Runnable JAR? The Folder I want to set as a currentDirectory is called "Beispiele". Thanks for your help!

    this.fileChooser.setCurrentDirectory(new File(("./Beispiele")));

java

jar

path

relative-path

runnable

0 Answers

Your Answer

Accepted video resources