55

When I use eclipse and see my name in the javadocs as the author, I also find the spellchecker marking my name as it does not understand that it is a proper name. Thus, I get the option of:

Add {word} to dictionary

but when I click on it, It says the user dictionary is missing and asks if I would like to create a new one. When I say yes, it just shows the spell checking preferences with a blank user dictionary field where I have the option to only add an existing user dictionary and no option to create a new one.

How do I create the user dictionary so that I can configure it for use in eclipse?

4
  • 2
    I blame eclipse dialog's poorly labelled field. From the way it is phrased, it looks like you need to select an existing dictionary somewhere. My hope is that they change the label to convey proper meaning.
    – Scalable
    Commented Apr 8, 2016 at 12:40
  • totally agree with you there, mate!
    – MozenRath
    Commented Apr 12, 2016 at 11:31
  • Somehow this has never been a problem for me in IntelliJ or NetBeans, but obviously it's been a problem for a lot of Eclipse users... Commented Oct 28, 2021 at 17:24
  • But, to be fair, for common misspelled words, the Eclipse spell checker is smarter than the NetBeans spell checker. Commented Oct 28, 2021 at 17:45

5 Answers 5

58
+50

When in C/C++, you must change the "Select spelling engine to use" option at the top of that options page to be "C/C++ spelling engine".

enter image description here

7
  • 1
    Thanks! This issue is also discussed here: bugs.eclipse.org/bugs/show_bug.cgi?id=310237 Commented Feb 10, 2015 at 11:47
  • 6
    If you don't do this, everything appears to work, but nothing actually happens when trying to add new words from C++ code.
    – fadden
    Commented Jun 29, 2016 at 1:00
  • 2
    I was missing the Select spelling engine to use drop down - this seems so counter intuitive when you click the 'add new dictionary' button after trying to add a word to it. This was driving me crazy. +1 Commented Mar 28, 2017 at 13:00
  • Ah ha! After applying your change, fiiiiiiiinally this answer works now!: stackoverflow.com/a/23237328/4561887. It takes both your change and his! Commented Apr 20, 2019 at 1:46
  • This blog post points out this answer too: syncor.blogspot.com/2011/03/…. Commented Feb 8, 2021 at 7:38
55

Yes, you can.

Create a text (.txt) file in a directory on your computer. Your Eclipse workspace may be appropriate. Add a new word on each line in the .txt file. You don't have to remember every word, that's what the help option is for, when you type a misspelling/a word eclipse doesn't know.

Go to WindowPreferencesGeneralEditorsText EditorsSpelling and find the User defined dictionary section. To the right of that is a button called "Browse" click it, navigate to your text file, and choose it. You'll need to restart Eclipse in order for the changes to take effect.

You can also just type in the text box next to "User defined dictionary" in the Spelling Menu the path to where you want the file to be. It doesn't have to exist, but you must be familiar with paths if you want to do this.

4
  • 3
    As of Eclipse Neon.3 (4.6.3) it does not need to be a .txt file; it can have a different extension and perhaps no extension and you must close and reopen Eclipse in order to get the newly applied user dictionary to take effect.
    – H2ONaCl
    Commented Jul 25, 2017 at 20:27
  • It would be nice to add the above comment about having to reset eclipse to the answer.
    – Mark Walsh
    Commented Jul 8, 2019 at 21:57
  • finally got around to working out how to do this :-) I have got very frustrated with just following the clicks telling me 'how to add a dictionary', and then not! The advise given with explicitly Window → Preferences → General → Editors → Text Editors → Spelling, then restart eclipse worked. BTW I'm on eclipse - Version: 2023-03 (4.27.0) Commented Apr 11, 2023 at 18:33
  • This answer worked for me (no need to restart either). I have downvoted the one that did not.
    – m4r35n357
    Commented Jul 19, 2023 at 9:33
10

The user dictionary is just a plain text file with one word per line.

You do not have to create this file, just put the path to where you want to store the file in the 'User defined dictionary' configuration that Eclipse shows you and it will create the file.

1
  • that additional info about not needing to create it helped. Thanks!
    – MozenRath
    Commented Apr 23, 2014 at 8:43
0

Another thing to watch out for, at least in Eclipse Kepler, is that the dictionary cannot be located in C:\ProgramFiles\eclipse. I could not add words to the dictionary when I put the file there, maybe because it doesn't have permission to that directory.

0

I'm late to the party, but for Eclipse I kept having a spelling check error pop up for the word "accessor" that I was using in a comment for a school project. I found that using @DonyorM / @Gabriel Staples comment helped me solve this problem.

I just went to Window → Preferences → General → Editors → Text Editors → Spelling and typed in the word I needed to add next to the "User defined dictionary" box. I then clicked browse, created a folder in my workspace labeled as "ECLIPSE DICTIONARY", then created a text file labeled as "DICTIONARY" in that folder. After creating and directing eclipse to use that pathway, it added the word automatically to the text file.

(Also, for clarification you don't have to label the folder and text file to what I labeled it as. I'm sure you could name it whatever you wanted.)

Now I don't have to look at that pesky red line underneath that particular word.

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