This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes File Extensions Mappings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "File Extensions Mappings" Watch "File Extensions Mappings" New topic

File Extensions Mappings

Jean-Philippe Pellet

Joined: Sep 10, 2003
Posts: 2
My application writes files with extension .xtp. How can I tell the OS (be it Windows, Mac OS X or another *nix) to use my compiled java application when I double-click on my .xtp file? Does my application have to be a jar archive? If possible I would like to do that in my code, but if it's not possible then how can I do it 'by hand'?
VIJAY Yadlapati
Ranch Hand

Joined: Aug 04, 2003
Posts: 175
I am not familier with OS other than Windows. For Windows, you should use JNI to create a new Key under HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts, and a node under it, with Value Name as Application, Value data as application - with which the file has to be opened.
It is sorta covered in the JavaRanch Style Guide.
subject: File Extensions Mappings
Similar Threads
unsynchronized file reading
Monitoring Folders
batch file run from Windows or Linux
default calling the java file in windows and linux
xsl and jsp