Title: jython --boot cannot load console support on Windows
Type: Severity: normal
Components: Versions: Jython 2.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: eaaltonen, jeff.allen, zyasoft
Priority: low Keywords:

Created on 2015-11-12.16:17:23 by eaaltonen, last changed 2018-03-05.21:44:17 by jeff.allen.

msg10464 (view) Author: (eaaltonen) Date: 2015-11-12.16:17:22
Jython startup is slowish, so I tried `jython --boot` resulting in the following:

$ jython --boot
[ERROR] Terminal initialization failed; falling back to unsupported
java.lang.NoClassDefFoundError: Could not initialize class org.fusesource.jansi.internal.Kernel32
        at org.fusesource.jansi.internal.WindowsSupport.getConsoleMode(
        at org.python.jline.WindowsTerminal.getConsoleMode(
        at org.python.jline.WindowsTerminal.init(
        at org.python.jline.TerminalFactory.create(
        at org.python.jline.TerminalFactory.get(
        at org.python.jline.console.ConsoleReader.<init>(
        at org.python.util.JLineConsole.install(
        at org.python.core.Py.installConsole(
        at org.python.core.PySystemState.initConsole(
        at org.python.core.PySystemState.doInitialize(
        at org.python.core.PySystemState.initialize(
        at org.python.core.PySystemState.initialize(
        at org.python.core.PySystemState.initialize(
        at org.python.util.jython.main(
msg10469 (view) Author: (eaaltonen) Date: 2015-11-13.11:10:23
Jython 2.7.0 (default:9987c746f838, Apr 29 2015, 02:25:11)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.7.0_67
Type "help", "copyright", "credits" or "license" for more information.
msg10470 (view) Author: Jim Baker (zyasoft) Date: 2015-11-13.23:06:54
This seems to be a general problem on Windows. Likely this is because the Jansi library depends on a DLL for its functionality when run on Windows, and the way it loads up the DLL is incompatible with Jython being on the bootpath.

Presumably we need to disable attempting using the bootpath for Jython on Windows; or if we do allow it, to disable readline support.
msg11745 (view) Author: Jeff Allen (jeff.allen) Date: 2018-03-05.21:44:17
JLine extracts a copy of the jansi DLL to temporary storage (twice for some reason -- see #2589).

In 2.7.2a1 we get:
PS> jython --boot
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no jansi in java.library.path]
        at org.fusesource.hawtjni.runtime.Library.doLoad(
        at org.fusesource.hawtjni.runtime.Library.load(
        at org.fusesource.jansi.internal.CLibrary.<clinit>(
        at org.fusesource.jansi.AnsiConsole.wrapOutputStream(

Clearly we are here: but I'm not much the wiser.
Date User Action Args
2018-03-05 21:44:17jeff.allensetpriority: low
nosy: + jeff.allen
messages: + msg11745
milestone: Jython 2.7.2 ->
2016-02-08 15:53:21zyasoftsetmilestone: Jython 2.7.2
2016-01-15 15:31:42zyasoftsettitle: jython --boot throws error on Windows 7 -> jython --boot cannot load console support on Windows
2015-11-13 23:06:54zyasoftsetnosy: + zyasoft
messages: + msg10470
2015-11-13 11:10:24eaaltonensetmessages: + msg10469
2015-11-12 16:17:23eaaltonencreate