I went through the following doc center and tried to create my own URI scheme myDocs:
https://msdn.microsoft.com/en-us/library/aa767914(v=vs.85).aspx
The following is my Java program. It takes a command line argument and returns the URL in the browser.
import java.awt.Desktop;
import java.io.IOException;
public class URIOpen {
public static void main(String args[]) {
if (args.length == 0) {
return;
}
String uri = args[0];
try {
Desktop.getDesktop().browse(java.net.URI.create(uri));
} catch (IOException e) {
System.out.println(e.getMessage());
}
}
}
I updated the default value field for the command key as shown below.
"C:\Program Files (x86)\Java\jdk1.8.0_102\bin\java" -cp "C:\Users\Krishna\Documents\Study\Miscellaneous\examples" "URIOpen" "%1"
When I try to run a command myDocs:http://google.com, I end up opening endless command lines.
The structure of the URI scheme schema entry in the registry is as follows. Any help on this?

source
share