I have a simple class Main,
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println(scanner.nextLine());
}
When I start it from IDEA, everything works fine, but when I start my application from the console - I get Exception in thread "main" java.util.NoSuchElementException: No line found
I use gradle, start with the gradle task
task runApplication(type: JavaExec) {
dependsOn jar
classpath += files(jar.getArchiveFile())
classpath += sourceSets.main.runtimeClasspath
main = "com.Main"
}
Running on Windows 7 with Java 1.8