Can't find system.out.println()
I created a project, it asked me to select JDK version and finish.
I couldn't find system
namespace in autocomplete.
I typed it manually but IDEA told me that system
doesn't exist.
Solution 1:
It's System
(with a cap)
Some very useful shortcuts:
soutm (+TAB) ==> System.out.println("Class.And.Method.Name")
soutv (+TAB) ==> System.out.println("Last variable used = " + value);
sout (+TAB) ==> System.out.println();
I really love IntelliJ. Glad I moved to it from Eclipse a couple of years ago ;)
Solution 2:
Just type sout
.
public class Main {
public static void main(String[] args) {
int data = 1;
System.out.println(); ===>sout
System.out.println("Main.main"); ===>soutm
System.out.println("args = [" + args + "]"); ===>soutp
System.out.println("data = " + data); ===>soutv
}
}
sout
- just print System.out.println()
soutm
- added Class name & method name
soutp
- added parameter
soutv
- added last variable name
Solution 3:
We can change the auto complete settings to to ignore case. Go to:
File -> Settings... -> IDE Settings -> Editor -> Code Completion
and change 'Case sensitive completion' to 'None'.
Solution 4:
I came from eclipse and was using the syso
shortcut, so I have just added it to my live template. Here is a templete:
System.out.println($END$);
Here is a screenshot:
Don't forget to add Java as applicable context (at the bottom of the window).
Now it will appear as a hint while you typing syso
here is a screenshot:
Hope it helps