Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why sysout won't work?

I checked the preferences settings in my Eclipse, it's all set to default with sysout option on, but when I typed sysout in eclipse, it won't automatically go into System.out.println(). I've checked several other related topics which mention ctrl + space. It is a shortcut for input method on my computer. I don't know if this is related to my unable to use the sysout. If not, please let me know how I can get my sysout working. If yes, please kindly let me know how I can reset 'ctrl + space' or set other shortcut for content assistant.

like image 307
Zoe Avatar asked Aug 02 '13 22:08

Zoe


4 Answers

Eclipse > Preferences > Java > Editor > Content Assistant > Advanced

Make sure Template Proposals is checked in one of the shown lists.

like image 56
Muhammad Gelbana Avatar answered Nov 15 '22 17:11

Muhammad Gelbana


public static void main(String[] args)

This public static void ... blah blah has to be put for the sysout to work

like image 34
Mak Insane Avatar answered Nov 15 '22 18:11

Mak Insane


In recent version of Mac (10.14.1) , Mac OS Settings --> Keyboard --> Shortcuts(tab) --> Input sources.

uncheck the setting ctrl +Space.

Now go to Eclipse IDE and it should work.

like image 45
sofs1 Avatar answered Nov 15 '22 19:11

sofs1


You have to press Ctrl + Space for the sysout (or equivalently: syso) shortcut to work in Eclipse, as sysout is not part of Java in anyway, on the contrary: it's an abbreviation introduced in Eclipse that only works after you press Ctrl + Space and expands to System.out.println().

By the way, syserr (or equivalently: syse) will expand to System.err.println() after pressing Ctrl + Space.

like image 29
Óscar López Avatar answered Nov 15 '22 17:11

Óscar López