System.console().readPassword() via SSH
Marshall Dunbar <[email protected]> Fri, 15 Oct 2021 20:32:49 +0000
| Newsgroups | gmane.comp.lang.as400.java |
|---|---|
| Message-ID | <BN6PR06MB3268AFF547A1883D79E10D1ED6B99@BN6PR06MB3268.namprd06.prod.outlook.com> |
I’m using System.console().readPassword() to read input from the console without echoing characters. This works find on OpenJ9 on my Mac terminal and when using QSHELL in a 5250 terminal. However when running via SSH to the IBMi it fails:
Exception in thread "main" java.io.IOError: java.io.IOException: Qyj9SetEcho failed
at java.io.Console.readPassword(Console.java:328)
at com.dpslink.scm.extend.Util.readLineFromConsole(Util.java:146)
at com.dpslink.scm.extend.CommandLineInterpreter.CommandImport(CommandLineInterpreter.java:87)
at com.dpslink.scm.extend.CommandLineInterpreter.main(CommandLineInterpreter.java:47)
Caused by: java.io.IOException: Qyj9SetEcho failed
at java.io.Console.echo(Native Method)
at java.io.Console.readPassword(Console.java:326)
... 3 more
IBMi Java being used:
java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 8.0.6.30 - pap6480sr6fp30-20210507_01(SR6 FP30))
IBM J9 VM (build 2.9, JRE 1.8.0 OS/400 ppc64-64-Bit Compressed References 20210415_469669 (JIT enabled, AOT enabled)
OpenJ9 - c2bc063
OMR - fa000e8
IBM - 8165371)
JCL - 20210419_01 based on Oracle jdk8u291-b09
Is this a known limitation or a bug? Google search came up with nil.
--
Marshall
--
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
Before posting, please take a moment to review the archives
at https://archive.midrange.com/java400-l.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com