Robin's Blog

How to: Solve the ‘Ctrl-Space (auto-complete) not working’ problem in Eclipse

This problem is known by various names such as:

  • Ctrl-Space doesn’t do anything in Eclipse!
  • Why can’t I get auto-complete to work properly in Eclipse?
  • I’ve just set up a new University computer and things don’t work like they do on my laptop (maybe that one’s just me…)

It’s actually very simple to solve, but the problem is actually nothing to do with Eclipse. First of all, let’s see what the problem is:

You’ve just installed Eclipse, are starting to do some programming in it, and want to use the very handy auto-complete feature. So, you type part of a function name and press Ctrl-Space, waiting for the magic to work and the rest of the name to be automatically typed….but it doesn’t happen!

In the image above (which unfortunately doesn’t include the cursor) I had typed ST, and pressed Ctrl-Space to autocomplete it but nothing happened.

When trying to fix this myself, I went in to the Eclipse options (Windows->Preferences, then General->Keys) and tried to find the command for auto-complete. Helpfully, it’s not called autocomplete or anything like that – it’s called Content Assist. This showed me that, as I expected, Content Assist was assigned to Ctrl-Space:

So why wasn’t Eclipse picking this up? I tried setting the key for Content Assist manually, but when I deleted the text in the key binding box and pressed Ctrl-Space, it showed that only Ctrl registered – somehow the spacebar press was being ‘eaten up’ by something else. What could it be?

The simple answer is: the Windows language services utility – obvious really! This seems to be set by default (at least some of the time) to switch between languages by using Ctrl-Space. On my personal computer I only have one language set up (English (UK)), but on the university computers there are loads – French, German, Italian, Chinese (simplified) etc. You can find out what languages you have set up by going to Control Panel -> Region and Language -> Keyboards and Languages (tab) and then Change Keyboards (again, how obvious…). You’ll see a list of languages installed – remove any that you don’t want (click the language and then click the Remove button) until you only have the ones you want left. That fixed it for me, but you can also check the Advanced Key Settings tab to make sure that none of the keyboard shortcuts that are set include Ctrl-Space.

Once you’ve done that, Ctrl-Space should work nicely


If you found this post useful, please consider buying me a coffee.
This post originally appeared on Robin's Blog.


Categorised as: Computer Help, Computing, IDL, Python, Windows


43 Comments

  1. ameen says:

    I have the same problem here, using win7, same problem with all versions of ecclipse,tried helios, ganymede, indigo, but wont budge. I have tried all the above options, (tried removing all keyboards, removed all key associations from advanced tab, everything possible) but still ctrl+space not working for me, i think some other program has hijaked my keys, can you please let me know how to find out which program is using up my ctrl + space

  2. ameen says:

    Hi Dude,.. THANK GOD FIXED IT, i restarted the machine after doing all the above steps, now its working fine

  3. Rahul says:

    Thank you very much.. Have been struggling Since I installed eclipse on win 7.

    At last thanks to you, I am again in love with win 7.:)

  4. Douglas says:

    Thanks dude, you saved my life!
    I’ve been trying to solve it for days, now it’s working!!

  5. kurtz says:

    Thanks

  6. Asanke says:

    Thanks a Mill.
    In my case My eclipse was working fine on Ubuntu 10.04 and I did an upgrade to 12.04LTS. With the upgrade the CRTL+Space has been assigned to a system task.

    How to:

    just type ‘ibus-setup’
    home:$ ibus-setup
    Under General tab –. Keyboard shortcuts find ‘CRTL+Spcae’ defined.
    Change it to something else Ex: CTRL+ALT+Space
    Apply and close.
    You are done!!!

  7. Ashqar says:

    WOOOHOOO , thanks man that was awesome

  8. Somu says:

    Thanks a lot Robin. It worked for me.

  9. SARAV says:

    Yes, It is worked. Thank You.

  10. Govardhan Reddy says:

    Excellent. It is working fine. Because of this I have faced lot of issue and impact on my development. Thanks

  11. Yulius Harjoseputro says:

    Yeahh,, thanks man.. It is working for me..
    Thanks

  12. Rajib Naik says:

    follow the above step and restart it.it worked for me
    Thanks

  13. santo says:

    @Asanke: THANK YOU!!
    you made my day!

  14. bob says:

    on ubuntu studio the ctrl-space was assigned at the operating system level to change the keyboard input method. I had to change the Next Input Method in Settings Manager–>Keyboard Input Methods–>Next Input Method field.

    I changed it from ctrl-space to ctrl-alt-shift-space.

  15. Kavya B U says:

    Thanks, that worked 🙂

  16. Prasad says:

    I am not able to write any Chinese character or Japanese character in eclipse juno and widows 7 .Please any one can help me .

  17. Thanks a lot. The last paragraph saved my day.

  18. ankit says:

    down vote

    This happend to me too.

    For some reason Kepler changes the settings for Content Assist on Juno workspaces. Checking the Java Proposals checkbox in Preferences -> Java\Editor\Content Assist\Advanced should resolve this problem

  19. maryam negar says:

    Checking the Java Proposals checkbox in Preferences -> Java\Editor\Content Assist\Advanced should resolve this problem.

  20. hyfsterion says:

    I had the same problem on Ubuntu 12.04 LTS. Ctrl+space did not activate Content Assist, although it was properly configrued as described above by Robin.

    Simillary the problem had nothing to do with Eclipse – just disable iBus (right click -> Input methods -> click “None”)

  21. Ashish Desai says:

    For Linux Ubuntu / Lubuntu desktops you will face similar issues. To fix the issue you should install the dconf editor via
    sudo apt-get install dconf-editor

    Once you install open up the dconf editor and navigate to desktop > ibus > general > hotkey and remove the Control + Space key from the trigger and triggers settings. Make sure you keep the empty [] brackets.

  22. Imtiaz says:

    Thanks! I had 2 regional languages. Chinese and US. Removed chinese Keyboard & restarted eclipse. Now ctrl+space works fine!!! 🙂

  23. G srinu says:

    I solved my problem with your answer

  24. Sreepad Chitrgar says:

    Awesome Answer… Working Fine.. Infinity Thanks to you…

  25. Vu Le says:

    This made my day! Awesome! Thanks a lot!

  26. Shrikant says:

    Java Proposal solved my problem on Eclipse. Thanks Ankit

  27. KaUsh says:

    Thanks dud.
    It really solve my problem…

  28. Guido says:

    Aprete la combinación de CTRL+Espacio no me funcionaba, resulta que esa combinación es para cambiar el idioma y cada vez q lo apretaba se cambiaba el idioma, deshabilite esa opción del sistema operativo y funciono..

  29. Punto says:

    Thanks Robin. With your suggestions I fix the problem in a a couple of minutes. Restart of my Win 7 wasn’t required

  30. Lakshan says:

    Hey! worked for me! thank you so much 🙂

  31. Esteban says:

    Thank you Asanke!!!! The author should include this information in the article for all the linux users….
    Using: Ubuntu 14.04
    WM: LXDE

  32. Kapil says:

    I assigned the keyboard shortcut binding to java code assist in stead of removing a language and now its working fine, thanks

  33. Rajesh says:

    ibus-setup > Changing keyboard shortcut
    fixed this problem for me on zorin 9.

  34. NoName says:

    Thank You! Dude, you saved my life!

  35. Anoop says:

    Thanks for the info, i was looking it for hours 🙂

  36. Chandra says:

    Finally ,,,, it worked for me too. thanks 🙂

  37. NL says:

    Thanks for the info. This worked for me –
    “check the Advanced Key Settings tab to make sure that none of the keyboard shortcuts that are set include Ctrl-Space”

  38. Snf says:

    Thanks. it worked 🙂

  39. Gouthami says:

    Thanks a lot for the hint. In my case, content assist was not having any key binding for Java API Proposals, and Java Type. After I added Ctrl+Space, it started working 🙂

    Thanks a ton!!

  40. […] Nov 15, 2011 … This problem is known by various names such as: Ctrl-Space doesn’t do anything in Eclipse! Why can’t I get auto-complete to work properly in Eclipse? … programming in it, and want to use the very handy auto-complete feature. … sure that none of the keyboard shortcuts that are set include Ctrl-Space. How to: Solve the ‘Ctrl-Space (auto-complete) not working’ problem … […]

  41. Dinesh says:

    Thank you!!

  42. Gary Trend says:

    Thanks Asanke! You were right, this ibus-setup thingie was the issue. Now solved the eclipse ctrl-space works as expected. Much obliged.

Leave a Reply

Your email address will not be published. Required fields are marked *