Why sysout won't work?

前端 未结 15 1043
死守一世寂寞
死守一世寂寞 2020-12-30 10:44

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 S

相关标签:
15条回答
  • 2020-12-30 11:19

    After trying all the answers above with no success I found another reason why Ctrl+Space could be prevented from working.

    In my instance Ctrl+Space worked for some projects in the workspace but not others. I discovered that the project that it did not work for did not have the jdk in the build path, instead it had the jre for the application server (weblogic 12). The application ran fine on the server but Ctrl+Space to open the template proposals didn't work and other things like syntax highlighting were not quite right.

    I hope this helps anyone who comes to this questions 3 years after it was asked (Like I did).

    0 讨论(0)
  • 2020-12-30 11:22
    Eclipse > Preferences > Java > Editor > Content Assistant > Advanced
    

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

    0 讨论(0)
  • 2020-12-30 11:22

    For me sysout in eclipse created in two lines. println() in new line..Then I found myself how to avoid this and get System.out.println in one line ..go to Windows > Preferences > Java->Templates (or type templates on search field in top left corner box).Then In template configuring section uncheck "use code formatter"..thats it.. :)

    System.out
             .println();
    
    0 讨论(0)
  • 2020-12-30 11:22

    I started having the same problem with sysout shortcut when I installed the Scala plug-in in Enclipse. None of the answers worked, but the solution turned out to be very simple. I unchecked all Scala templates in Preferences -> Scala -> Templates So if you use any plug-ins, make sure their templates do not get in the way of your Java templates.

    0 讨论(0)
  • 2020-12-30 11:35

    Seems like you in windows and your keyboard shortcut for eclipse is got replaced with the system keyboard shortcut for language. well, either you replace it the keyboard combination to shows the template proposals by :

    1. open the preferences dialog
    2. go to general -> keys
    3. in the search dialog, find the command `Content Assist`
    4. change the binding and then click OK button
    

    or, you can change the combination key to change the language in the Text Services and Input Language and then go to the Advanced Key Settings tab and then change the key sequence.

    0 讨论(0)
  • 2020-12-30 11:35

    I had the same problem. I had ctrl + Space used as a shortcut for input source in Mac. To disable this go to settings -> Keyboard -> Input Sources and uncheck Select the previous source. Than syso shortcut will work.

    0 讨论(0)
提交回复
热议问题