My console app tries to read a user's response to list of choices printed to the console. However, when I execute the app via a Windows Command Prompt window, it just returns to the command prompt. No list of choices is displayed, and the app seems to have exited. The command type is "Console" in Advanced Installer.
During testing, I tried your options to redirect System.out and System.err to files. In the System.out file, the list of choices appeared! Why there now, but not the console before? Also I determined from other tests that the app seems to be exiting because the readLine() is returning null, which should only happen at the end of stream, which should never happen to System.in. Instead that call should have blocked until the user pressed "Return".
Also, I noticed that when launching the app by double-clicking on the item in the File Manager, the hourglass would appear for a few seconds, then go back to the normal cursor. During this time, there was no console window opened. All my other console apps open a console window, even if just briefly to display a "usage" message.
At one point later I got desperate and tried to change the name of the app from "Configuration" to "Config". I verified that the "Files and Folders" section and "Java Products" sections both showed the new name. However, when I later looked at the raw AIP file (more desperation) I noticed there there were references to both the old and new name. (Sorry, the file was later changed, so I can't provide more detail.) So something got corrupted.
In the end, I deleted that Java Product, and started from scratch, rebuilding with the same options. This time is worked like all the other console apps.
Bug summary:
1) where did my System.out go?
2) Why didreadLine(() immediately return null instead of blocking for input?
3) Why didn't double-clicking on the app launch a console window?
No need to respond to this in detail, since it's working now. Just want to make sure you are aware of the problem. (I noticed a similar posting from a few years ago regarding a console app that did nothing when run from the command line, but then suddenly worked... maybe related?)
FOLLOW US
Get the latest news in Application Packaging