3

I found that I am unable to do this in usual way (on Windows 7 prof x 64). When I open "Open with..." dialog I see no notepad++ in list. So I press "Browse" button and select it explicitly. But after I select OK it replaces for conventional notepad on the fly. Looks like some clever hinting from MS :)

So, how to disobey this hint?

Probably, the reason is either that notepad++ is in Program Files (x86) folder, or that notepad++ has pluses in it's name.

3 Answers 3

3

If you don't want to mess around directly with registry keys, changing what application a file opens with simple with Default Programs Editor

(You might want to create a backup of your settings first- you can use the link on the main app screen to do this)

Possible Solution #1:

File Type Settings -> Context Menu -> (search for .java) -> Next

Setting notepad++ to be the 'open' command for .java files

That'll get you on the context menu screen- click "Edit Selected Command" next and then browse to notepad++.exe, wherever that is.

Possible Solution #2:

Based on your comments it sounds like you might first have to change the file type of .java files. If the Possible Solution #1 doesn't work, try this:

File Type Settings -> Change an extension's file type -> (search for .java)

Changing .java application with Default Programs Editor

Note the File type column- I'm speculating it might be txt_auto_file or similar? We're going to change it. Click next and then Add a new file type. Write in a description or choose an icon if you want (this can also be done later). Then simply click Save File Type, and re-run Possible Solution #1 (or, Windows' built in "Open With..." business should now work).

1
  • 1
    This worked! Thanks! Forgot about that new control panel applets!
    – Dims
    Dec 3, 2011 at 7:15
1

With Notepad++, Settings/Preferences..., in the dialog box, in the tab File Association, choose .java.

1
  • How to save preferences?
    – Dims
    Dec 2, 2011 at 17:07
1

I just did this on my Win 7 Prof x64 with Notepad++ v5.9.1 and I checked the box for "Always use the selected program for this type of file". I closed notepad and re opened the file and it worked fine. I then opened a text file and it opened in notepad just fine.

Notepad having ++ in it's name and in the (x86) folder has nothing to do with it. The .exe could be on your desktop and it would still work.

Also in Notepad++ click Settings>Preferences>File Associations and make sure .java is listed under java, c#, pascal.

Lastly if for some reason this isn't working for you, you can do this directly in the registry. REMEMBER TO BACK UP ANY KEYS YOU CHANGE BEFORE YOU CHANGE THEM.

Double check this first:

HKEY_CLASSES_ROOT\.java
(Deafult) = "java_auto_file"

and if that is correct then change the string in the following. This is copied form

HKEY_CLASSES_ROOT\java_auto_file\shell\open\command
(Default) = "C:\Program Files (x86)\Notepad++\notepad++.exe" "%1"

If you have something other than "java_auto_file"in the first part then change that text in the second string.

4
  • Thanks! Tried this myself but made a spell mistake!
    – Dims
    Dec 2, 2011 at 17:07
  • Sorry was wrong: didn't worked. Asked me as if it was not associated and the associated with notepad.
    – Dims
    Dec 2, 2011 at 17:08
  • If you browse to HKEY_CLASSES_ROOT\java_auto_file\shell\open\command what is entered for the default value? Also I just changed the key to make more sense for manual entering, I had just pasted from extracted registry key which is not good if you are going to manually enter it. Dec 2, 2011 at 17:32
  • I don't understand, what was wrong! Everything was ok from the first view....
    – Dims
    Dec 3, 2011 at 7:16

You must log in to answer this question.

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