I'm getting the following error while running the program in IntelliJ IDE. It's a simple program which takes input from cmd and prints it. When i run it through cmd it works fine but dosen't work on intelliJ
Exception in thread "main" java.lang.NullPointerException at
revArr.main(revArr.java:6)
public class revArr
{
public static void main(String[] args)
{
// Using Console to input data from user
String name = System.console().readLine();
System.out.println(name);
}
}