Why sysout won't work?

前端 未结 15 1036
死守一世寂寞
死守一世寂寞 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:12

    In my case it didn't work because ctrl+space was being used by another program Ubuntu(I-Bus) in my case ref. here Try changing ctrl-space by another key combination in general->keys to find out if this is causing the problem.

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

    set your perspective on default and your problem will solve. window -> perspective ->open perspective -> other -> select default

    0 讨论(0)
  • 2020-12-30 11:13
    public static void main(String[] args)
    

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

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

    I was facing the same issue. If you use OS X Eclipse Ctrl+Space shortcut can be interfering with OS X system's "Selecting previous input source" shortcut using Ctrl+Space shortcut as default. OS X system shortcut has higher priority, that is the reason why Eclipse does not work.

    Just go to System Preferencies/Keyboard/Shortcuts/Input Source and uncheck the "Selecting previous input source" or change the shortcut on something else. Eclipse should work after that even without restart.

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

    Select in the menu bar "Window > Preferences > Java > Editor > Templates" deselect at the lower end of window: "Use code formatter"

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

    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.

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