title: How to get a file that it is inside my jar file?
body: <p>I need to access to a xsd file that it's inside my jar. My problem is that my classpath is <code> C:\Users\fabio\Documents</code>.</p>
  <p>My jar file it's in that path too , so how can I get the file that I need?</p>
  <p>I tried <code> File xsdFile=new File(String.valueOf(MigrationsApplication.class.getResource(&quot;DBRegister.xsd&quot;)));</code> but got this error message <code> schema_reference.4: Failed to read schema document 'file:/C:/Users/fabio/Documents/null', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not &lt;xsd:schema&gt;.</code></p>
  <p>This is my location of the xsd file I need
  <a href="https://i.stack.imgur.com/2gHLz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2gHLz.png" alt="enter image description here" /></a></p>