Accessing resources inside a JAR [duplicate]
问题 This question already has answers here : How do I read a resource file from a Java jar file? (9 answers) Closed 2 years ago . I'm making a test program for resource loading inside a jar and I'm having problems. I've read that you should use ClassLoader or alternatively getClass() to access a file inside a jar. Since the method that i use to load the resource is static, I use ClassLoader.getSystemResource(String path) . My program finds the file but says that the path contains invalid syntax