Getting the path of a running JAR file returns “rsrc:./”
问题 My code runs inside a JAR file and I need to get the full path of that file. For example, my JAR is called example.jar and is located at D:\example\ So I need to get "D:\example\example.jar" by some code inside that jar. I have tried many methods to get that path, but none of them worked correctly. One of them is getClass().getProtectionDomain().getCodeSource().getLocation().toURI().getPath() Many people say that this works for them, but it returns "rsrc:./" for me. I have searched after that