Reputation: 23
I'm looking for a way to launch my java application when using a custom URI. Something in the lines of movie://superman/
This should start my application and display information about the movie "Superman".
if friends of my have my application installed as well, i can send them that URI so they can click on it.
I used to do this back in the days in VB6 but i lost my code and forgot how to do it.
OS: windows
Any help would be appreciated.
Upvotes: 2
Views: 551
Reputation: 168835
..should start my application and display information about the movie "Superman".
If you can distribute your app. from a web site, you might take a slightly different approach:
xuri
.clickthis.xuri
file containing the URI of interest.-open clickthis.xuri
as arguments to the main(String[])
.This approach should work on any OS with 'modern' Java installed. JWS was available since 1.2, & became co-bundled with the JRE around 1.4.2.
Upvotes: 0
Reputation: 308131
The actual mechanism to implement this is operating-system dependent (and thus not accessible from pure Java).
The general idea is to register your application as the protocol handler for the protocol in question.
On Windows you do that by writing the appropriate registry keys
Upvotes: 6