I'm struggling to resolve a problem which seems very strange to me. I've looked trough at least five similar topics here on StackOverflow and neither of them provided an answer. But to the problem itself: I want to read in a file on app's startup. When I run the app in the IDE (IntelliJ Idea) everything is OK. Although when I build it with Gradle Java throws FileNotFoundException:
java.io.FileNotFoundException: file:/home/user/IdeaProjects/time-keeper/build/libs/time-keeper-0.7-beta.jar!/data.csv (No such file or directory)
The path to the file is correct, the file exists, the jar has proper permissions. The declaration:
File dataFile = new File(ClassLoader.getSystemResource("data.csv").getFile());
Handle<TimeTask> dataHandle = new FileHandle(dataFile);