First: it isn’t a file; it’s a resource in a JAR file, accessible via an InputStream. If you
really need it as a file, copy the InputStream contents into a temporary file (this isn’t typically the case)
Second: modern JVMs will restrict access across modules (JARs) - you’ll need to ensure that the resource is loaded from a class in the same JAR as the resource itself. Typically via
Foo::class.java.getResource(name)
(Kotlin).