It seems that java holds some cache in the URL (& files). for example I have a file "resourcs.txt" in the jar file in my class path. The contents of this file are: "Version 1"
new java.io.BufferedReader (new java.io.InputStreamReader( new URL("jar", "", "file:test.jar!/resourcs.txt").openConnection().getInputStream())).readLine()
returns "Version 1" (as expected)
I modify the contents of the file as "Version 2" and call this code again. And I still get "Version 1"
How can I clear this cache.
Note. I found out that this only happens on Linux.
source
share