I'm getting on learning Java for work, but even the most simplistic "hello world" script I can't get to run for some reason. Here is the code:
import java.io.Console;
class test2 {
public static void main(String[] args) {
Console console = System.console();
console.printf("Test");
}
}
I'm running this using IntelliJ, and the error I'm getting from the console is
Exception in thread "main" java.lang.NullPointerException
at test2.main(testclass.java:6)
My research is basically showing that the printf method is a "newer" (and I'm saying that with a bit of sarcasm) method, but that was only with versions 1.5 and up (don't quote me on that).
I've tried to find the answer as to why I'm getting this error, but nothing is pointing me in the right direction. Any and all help on this is greatly appreciated!