1

How do you configure Eclipse to produce System.out.println() with syso or the main method when typing main and then pressing Ctrl + Space without pressing Enter to confirm afterwards? I'm having a problem with this on Eclipse, running Ubuntu 14.04, but I know that it's possible because computers at my University(both Win and Linux machines) did this for me on Eclipse.

When pressing Ctrl + Space, I get the normal suggestion window. This works, but I would like to find out how to copy the set-up I have at Uni, where pressing Ctrl + Space after entering syso writes the statement automatically.

I hope I've explained this well enough. I didn't manage to find anyone with my problem so I asked this question.

Grzegorz
  • 107
  • 8
  • I teach Java and one of 10 students have the same issue(it annoys me, he doesn't care), just try other version of Eclipse, I have a notion that now they don't improve Eclipse anymore, they just change it. – Yoda Feb 28 '15 at 01:44
  • Just get used to typing `System.out.println` and `public static void main(String[] args)` in full. It really only takes 1-2 seconds. – user253751 Feb 28 '15 at 01:46
  • @Yoda I might try that when I've got more time, but I hope there to be an actual solution. – Grzegorz Feb 28 '15 at 01:48
  • A more descriptive title would increase this question's visibility. – tourniquet_grab Feb 28 '15 at 01:49
  • possible duplicate of [Setting auto complete shortcuts in Eclipse](http://stackoverflow.com/questions/10448039/setting-auto-complete-shortcuts-in-eclipse) – kdopen Feb 28 '15 at 01:51
  • @immibis I used to do that, but I prefer these shortcuts I've become used to, far more than typing, even though I still have to type the majority of things. – Grzegorz Feb 28 '15 at 01:51
  • @kdopen I looked at those, and they didn't fix anything. I only found how to make the suggestions for things. I changed `sysout` to `syso` and it didn't change a thing, and it shouldn't as the problem happens with all of the templates in preferences, where, I still get the window pop-up, not the automatic insertion. So after this, can we please de-flag my question? – Grzegorz Feb 28 '15 at 01:57
  • @tourniquet_grab thanks, I didn't even realise I didn't complete my question title. I'll get it right away. – Grzegorz Feb 28 '15 at 01:59

2 Answers2

1

Open Preferences and go to 'Java > Editor > Content Assist'.

Check the 'Insert single proposals automatically' option.

greg-449
  • 109,219
  • 232
  • 102
  • 145
  • 2
    Thank you, this does what I wanted. Turns out it was already checked, but the name helped me fix the issue. I had Intelligent Java Proposals suggestions also showing up in the default suggestions, therefore I wasn't getting a 'single proposal' which stopped it from automatically inserting it. – Grzegorz Feb 28 '15 at 13:23
  • I'm having the exact same issue. How did you turn off the intelligent Java Proposals suggestions? – samsamara Aug 24 '15 at 07:05
  • 1
    In the left pane of the preferences dialog, click the + to the left of "Content Asist" to open up "Advanced". in the top list, I unchecked "Java proposals" and it fixed the problem – draca Oct 16 '15 at 19:45
-2

I know in Netbeans, you can type in

sout //then hit tab on your keyboard

And the hit the tab button on your keyboard, and it automatically prints out

System.out.println("")

I'm not sure if this works in Eclipse. You can try it.

That Thatson
  • 309
  • 1
  • 2
  • 16
  • Thanks, this is exactly the effect I'm looking for. However, it is what I described above that should work in Eclipse, as I have done this on Eclipse running at my University labs. – Grzegorz Feb 28 '15 at 02:05