1

I basically want to check if the user can enter inputs and see outputs.

assuming we create a jar from this java application

public class Test{
   public static void main(String args[]){
      System.out.println("enter input");
      Scanner scn = new Scanner(System.in);
      System.out.println("You entered: " + scn.nextLine();
   }
}

When I run this as a jar file the application will just run in the background waiting for input forever, unless we run the application in an environment that supports I/O like a cmd or an IDE window,the user will see nothing and will not be able to enter any input

So how I can check if the user is able to see or give inputs(System.in and System.out are available)?

edit: this answer has fixed my problem: https://stackoverflow.com/a/1403817/10387008

Eboubaker
  • 618
  • 7
  • 15

0 Answers0