Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

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).

share|improve this answer
1  
This worked! Thanks! Forgot about that new control panel applets! –  Dims Dec 3 '11 at 7:15
add comment

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

share|improve this answer
    
How to save preferences? –  Dims Dec 2 '11 at 17:07
add comment

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.

share|improve this answer
    
Thanks! Tried this myself but made a spell mistake! –  Dims Dec 2 '11 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 '11 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. –  MaskedPlant Dec 2 '11 at 17:32
    
I don't understand, what was wrong! Everything was ok from the first view.... –  Dims Dec 3 '11 at 7:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.