I have a little problem with a part of the code. I have an offline version of my website inside my jar file, if the user needs help he can click on a button to open the HTML file where the software operations are explained.
In Eclipse it works fine when i use this lines if the help button is pressed :
URL url = getClass().getClassLoader().getResource("assets/help/index.html");
Desktop.getDesktop().browse(url.toURI());
However in the jar it doesn't works, i know i should use :
(getClass().getClassLoader().getResourceAsStream(resourcePath)
)
to get a resource located inside a jar file. But this function returns an InputStream object, whereas I need a URI or URL object if I want to use the browse(URI uri) method.
Therefore how could I succeed to open this file? Thanks for your answers!