I have tried googling but I cannot find an answer. I am writing a pure Java Desktop application. The help system launches by using the Desktop class browse function and giving it a URI. When I add a "? then the URI fails in Java. I want to pass the program version number to my offline help page in the browser, but I cannot figure out how to set a query string.
I am running on RedHat 6. I am using this code:
uri = new URI("file", "", programPath, "version=1.0.3", "");
Desktop.getDesktop().browse(uri);
I get an IOException on the browse function. All it says is that "Failed to show URI:"
If I take that full uri path and paste it in my browser, it works. I am completely stumped by this...
Okay so I never got it working the way I wanted to, but if I use the URI constructor that just takes a string and then I feed it the path as normal which always worked and then add "# + versionNumberVar"; then it works! It is frustrating because it won't work with "?version=" + versionNumberVar but I have what I need finally. Also, those other constructors do not work for me which is surprising. Unfortunately the URI error messages are cryptic and it just says "Failed to show URI".