title: Java: opening a resource (txt file) which is in a jar with OS standard application
body: <p>i get the error "AWT-EventQueue-0 java.lang.IllegalArgumentException: URI is not hierarchical".
  -I'm trying to use the java.awt.Desktop api to open a text file with the OS's default application.
  -The application i'm running is launched from the autorunning jar.
  I understand that getting a "file from a file" is not the correct way and that it's called resource. I still can't open it and can't figure out how to do this.</p>
  
  <p><code>open(new File((this.getClass().getResource("prova.txt")).toURI()));</code></p>
  
  <p>Is there a way to open the resource with the standard os application from my application?
  Thx :)</p>