Eclipse-man
Eclipse-man

Reputation: 1

System.out.println() shortcut doesn't work

I have newest Eclipse version installed on my laptop. When I try to use shortcut "syso" for System.out.println() (I click CTRL + SPACE) i get two new windows like this:

Eclipse - two windows syso

But on my older laptop, when I click same combinations of keyboard buttons, I instantly get System.out.println() without any questions like on the added picture.

I tried compare Eclipse settings between two computers, but there are huge number of preferences to configure under Eclipse. I open Preferences -> Java -> Editor -> Templates and found sysout, then clicked edit, but settings are same. Can someone help me, please? Many thanks, Java begginer

EDIT: I found on older laptop (and Eclipse version) there is no syso template, only sysout, but both working On new laptop same template, only working sysout

Upvotes: 0

Views: 13311

Answers (4)

Optimaz Prime
Optimaz Prime

Reputation: 937

  1. Go to file--->preferences--->user snippets

  2. Search for 'java.json' then include this line and save.

    "sout": { "prefix": "sout", "body": ["System.out.println("$1");"], "description": "print new line" },

Upvotes: 0

Moudi Alsaadi
Moudi Alsaadi

Reputation: 11

actually the keys you should use is (sout) then click on (tab) bottom.

Upvotes: 1

Subodh Joshi
Subodh Joshi

Reputation: 13482

Please check this

Windows->Preferences->Java->Editor->Templates

be confirm you have only one entry for syso in template menu.

Also check what code is written for me this shortcut is there

System.out.println(${word_selection}${});${cursor}

Upvotes: 2

Chandu D
Chandu D

Reputation: 501

you have to type sysout then click CTRL+space

Upvotes: 0

Related Questions