Hello, I am using intelliJ to make a kotlin project, and I have selected gradle as my build tool. When I run the file normally, like in the first picture, everything works, fine, but when I click Ctrl 2 times to run the "gradle run" command, I get the error: Process 'command 'C:\Users\UserName\.jdks\openjdk-24.0.1\bin\java.exe'' finished with non-zero exit value 1. To get a bit more insight, I ran "gradle run --scan", and then the terminal prints what it's supposed to print, which is "Please enter true or false: ", after which it expects keyboard input from the user. However, this is what's printed in the terminal:
Please enter true or false: 2 actionable tasks: 2 executed
Publishing a build scan to
scans.gradle.com requires accepting the Gradle Terms of Use defined at
https://gradle.com/help/legal-terms-of-use. Do you accept these terms? [yes, no] Exception in thread "main" java.util.NoSuchElementException: No line found
at java.base/java.util.Scanner.nextLine(Scanner.java:1677)
at MainKt.main(Main.kt:340)
at MainKt.main(Main.kt)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':run'.
Process 'command 'C:\Users\UserName\.jdks\openjdk-24.0.1\bin\java.exe'' finished with non-zero exit value 1
would anyone have any idea why this is happening? Why does it give this error but when I run the file normally, it works?