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.
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.
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 ;)
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
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'.
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
This can also happen because user has not created any main function or trying to test this directly in class without any function