I am using jpackage to convert a Java application into an executable .app file.
When running on macOS, as shown below, the application cannot read user input.
open -n /Applications/MyApp.app
The application can read user input if it is run as
open -n /Applications/MyApp.app/Contents/MacOS/MyApp.app
This is the code to read user input (using batch script is not applicable here)
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
while (true) {
String line = reader.readLine();
// process the string line here
}
What needs to be done to read user input when launching an application using open -n /Applications/MyApp.app (or another convenient command) ?