3

I recently chose cmd.exe as a default program for .jar files with instant regret.

How do I associate this back again with javaw.exe in the JRE? The default program check box is disabled, so selecting it again doesn't warrant a long term result.

I am using Windows 7. I'd appreciate your suggestions.

3 Answers 3

2

Get Default Programs Editor

  1. Start the program and click 'File Type settings'
  2. Click 'Context Menu'
  3. Select .jar from the list
  4. On the context menu page, select 'Open' or whatever the default is. You can either delete it and add a new item called "open", or just click Edit
  5. On the item page (either by adding or editing an item) browse to javaw.exe. It's in C:\Program Files (x86)\Java\jre6\bin (or, if you're running 32bit, without the "(x86)" part.
  6. Make sure the parameters look like this: "C:\Program Files (x86)\Java\jre6\bin\javaw.exe" -jar "%1" %*
  7. Then save it, of course.

Like this: Default Programs Editor - Select 'open' for .jar files

Default Programs Editor - Set path to javaw.exe

2
  • +1 This looks like a very nice prove of concept :-)
    – Ivo Flipse
    Oct 27, 2010 at 0:44
  • YES, fantastic! Thank you very much Factor Mystic, problem solved :)
    – braedy.
    Oct 27, 2010 at 7:02
1

you could use assoc and ftype internal cmd.exe commands for that purpose

assoc .jar=jarfile
ftype jarfile="c:\program files (x86)\java\jre6\bin\javaw.exe" -jar "%*"

assoc associates an extension with a file type, and ftype sets the default program to open that file type with

0

Instructions from following link (especially Method 1 & 2) might help:

http://www.mydigitallife.info/2008/06/20/how-to-edit-or-change-file-type-or-extension-associations-default-programs-in-windows-vista/

1
  • Again, this doesn't apply for Windows 7; but thanks anyway; I tried all of the methods on the pages, including some of the third-party software - no such luck.
    – braedy.
    Oct 27, 2010 at 7:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .