1

I am writing a console application with Java and gradle. In my java application i am trying to accept input from the user. It is working without any issue if i run via eclipse IDE. But if i run from command line it is not stopping to accept user input. Here is the build.gradle file. Here is link which says to add

run {
 standardInput = System.in
}

but still i could not succeed.

sourceSets {
    generated {
        java {
           srcDir 'src/generated/java'
        }
        resources {
           srcDir 'src/generated/resources'
        }
    }
    main {
        compileClasspath += sourceSets.generated.runtimeClasspath
    }
    test {
        compileClasspath += sourceSets.generated.runtimeClasspath               
        //System.setProperty('easy', 'false')       

    }
    run {
        standardInput = System.in
    }
}
Community
  • 1
  • 1
Raju
  • 249
  • 1
  • 3
  • 13
  • Gradle is just tool for building app. Why do you want to input from user during build? Is it some parametr for building? – user1722245 Sep 25 '16 at 14:36

1 Answers1

0

IF you want to customize your build process, use property via -PnameOfProperty=xxx (recommendation from gradle, instead of -D for java property)

user1722245
  • 2,065
  • 1
  • 18
  • 31