I have a simple Windows batch file that calls Gradle:
@echo off
gradlew app:run
Gradle then runs a Java program:
plugins {
application
}
application {
mainClass.set("org.hertsig.MyApp")
}
The program reads from stdin. When I run the run
task from IntelliJ directly, that works fine. But running it via the batch file, will not let the Java app see the input from stdin.
How do I connect stdin through my batch file?
Please note that this is about input to runtime-generated questions, so command line parameters, piping in a text file, or system properties will not do.
Windows 10, Gradle 7.2, Java 11.0.2