I'm on Ubuntu 16.04 and trying to set up Eclipse.
Why does the following code work in terminal but not in Eclipse jee-oxygen? Package helloworld is not included in the code I run in terminal.
package helloworld;
import java.io.*;
public class helloworld
{
public static void main(String[]args)
{
Console in = System.console();
String input = in.readLine();
System.out.println(input);
}
}
error :
Exception in thread "main" java.lang.NullPointerException
at helloworld.helloworld.main(helloworld.java:8)
/etc/environment :
JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java"
I've added java-8-openjdk to the build path in Eclipse.
What am I missing out here?