191

How can I enable autocomplete in Eclipse? I can't find it!

0

11 Answers 11

246

If you would like to use autocomplete all the time without having to worry about hitting Ctrl + Spacebar or your own keyboard shortcut, you can make the following adjustment in the Eclipse preferences to trigger autocomplete simply by typing several different characters:

  1. Eclipse > Preferences > Java > Editor > Content Assist
  2. Auto Activation > Auto activation triggers for Java
  3. Enter all the characters you want to trigger autocomplete, such as the following:

abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._

Now any time that you type any of these characters, Eclipse will trigger autocomplete suggestions based on the context.

7
  • 5
    This makes Eclipse's content assist behave more like IntelliJ's and Netbeans. Really helpful +1
    – Pranav A.
    May 13, 2018 at 22:33
  • 13
    @abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._ help for annotations May 21, 2018 at 7:45
  • 1
    @wallop I kind of doubt it, but I have no idea. Tbh I copied this answer from a comment on the accepted answer and it blew out of proportion. I don't even use Eclipse anymore.
    – intcreator
    Aug 30, 2018 at 17:34
  • 1
    This is a more complete answer. Thanks. Sep 6, 2018 at 3:37
  • 7
    Also remember to check the box: "Disable insertion triggers except 'Enter'", otherwise, it will annoy you when typing Sep 14, 2020 at 5:17
223

By default in Eclipse you only have to press Ctrl + space for autocomplete. Then select the desired method and wait 500ms for the javadoc info to pop up. If this doesn't work go to the Eclipse Windows menuPreferencesJavaEditorContent assist and check your settings here

10
  • 27
    Is there a way to get it to show up without hitting ctrl-space?
    – sinθ
    Oct 14, 2013 at 21:00
  • 3
    @MikeG Go to 'Window Menu > Preferences > General > Keys'. If you then select 'Content assist' you can change the default key binding.
    – THelper
    Oct 15, 2013 at 11:16
  • 154
    Change the default in Auto activation triggers for Java to ._abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ stackoverflow.com/questions/1959946/…
    – ftvs
    Nov 6, 2013 at 3:52
  • 2
    @ftvs Where is "default in Auto activation triggers for Java"? I couldn't find it. (Using 23).
    – kRiZ
    Dec 6, 2014 at 9:43
  • 10
    @kRiZ, Eclipse > Preferences > Java > Editor > Content Assist. In the bottom pane "Auto Activation" there's the field "Auto activation triggers for Java". Jan 27, 2015 at 10:57
17
  1. window->preferences->java->Editor->Contest Assist
  2. Enter in Auto activation triggers for java:
    abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._
  3. Apply and Close

other method:
type initial letter then ctrl+spacebar for auto-complete options.

1
  • 1
    Welcome to Stack Overflow! Please note you are answering a seven years old already answered question.Here is a guide on How to Answer. Aug 22, 2018 at 15:05
9

For auto-completion triggers in Eclipse like IntelliJ, follow these steps,

  1. Go to the Eclipse Windows menu -> Preferences -> Java -> Editor -> Content assist and check your settings here
  2. Enter in Autocomplete activation string for java: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._@
  3. Apply and Close the Dialog box.

Thanks.

5

For anyone having this problem with newer versions of Eclipse, head over to Window->Preferences->Java->Editor->Content assist->Advanced and mark Java Proposals and Chain Template Proposals as active.

0
3

I am not sure if this has to be explicitly enabled anywhere..but for this to work in the first place you need to include the javadoc jar files with the related jars in your project. Then when you do a Cntrl+Space it shows autocomplete and javadocs.

1
  • I don't have .jars... just a lot of .java files
    – john k
    Jul 21, 2020 at 15:17
2

If you are only unfamiliar with the auto-complete while typing syntax or inbuilt methods in the eclipse you can simply type the desired syntax or method name and press Ctrl+Space that will display the list of desired options and you can select one of them.

If the auto-complete option is not enabled then you have to check your settings from Windows menu -> Preferences -> Java -> Editor -> Content assist

0

If the auto-complete option is not enabled then you have to check your settings from Windows menu -> Preferences -> Java -> Editor -> Content assist->Advanced and mark Java Proposals and Chain Template Proposals .

0

In Eclipse click Windows Drop-Down > Click Preferences > Navigate to Java > Editor > Content Assist In order to Make the Auto suggestion/completion to work you have to set trigger that invoke the Auto Completion.

Now go to, Auto Activation > Auto activation triggers for Java

Enter all the characters you want to trigger autocomplete to be invoked in Eclipse IDE, such as the following:

Alpahabets: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ

OR

Special Characters: ~!@#$%^&*()_+=-:;'"|?/.,

OR

Any combination of Alpahabets & Special Characters.

Now based on the references, Eclipse will trigger autocomplete suggestions for you.

0

If you are programming in Java, make sure these setting are applied:

enter image description here

-2

For me, it helped after I changed the theme to 'mac' since I am running on a MacOSX.

Eclipse: >Preferences > General > Appearance > Choose 'Mac' from the menu.

1
  • 4
    This is irrelevant to the Contest Assist, you are just changing the theme of the editor :) -1
    – Pranav A.
    May 13, 2018 at 22:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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