Can't find system.out.println()

Intellij Idea

Intellij Idea Problem Overview


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.

Intellij Idea Solutions


Solution 1 - Intellij Idea

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 - Intellij Idea

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 - Intellij Idea

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 - Intellij Idea

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: enter image description here

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:
enter image description here

Hope it helps

Solution 5 - Intellij Idea

This can also happen because user has not created any main function or trying to test this directly in class without any function

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJatSingView Question on Stackoverflow
Solution 1 - Intellij IdeaGuillaumeView Answer on Stackoverflow
Solution 2 - Intellij IdeaDamith GanegodaView Answer on Stackoverflow
Solution 3 - Intellij IdeaShivaprasadView Answer on Stackoverflow
Solution 4 - Intellij Ideavlio20View Answer on Stackoverflow
Solution 5 - Intellij IdeasumerView Answer on Stackoverflow