Java: opening a resource (txt file) which is in a jar with OS standard application
问题 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. open(new File((this.getClass().getResource("prova.txt")).toURI())); Is