I am also having trouble with getting jline to work on Windows.
This is also how jline work for me using eclipse.
So I took jline's Example.java and put it in small gradle project.
Running it in a cmd prompt gives me the following.
>.\build\install\jansiExample\bin\jansiExample.bat color
[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(WindowsSupport.java:50)
at jline.WindowsTerminal.getConsoleMode(WindowsTerminal.java:204)
at jline.WindowsTerminal.init(WindowsTerminal.java:82)
at jline.TerminalFactory.create(TerminalFactory.java:101)
at jline.TerminalFactory.get(TerminalFactory.java:158)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:229)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:221)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:209)
at jline.example.Example.main(Example.java:50)
←[1mfoo←[0m@bar←[32m@baz←[0m> quit
←[33m======>←[0m"quit"
[WARN] Task failed
java.lang.NoClassDefFoundError: Could not initialize class org.fusesource.jansi.internal.Kernel32
at org.fusesource.jansi.internal.WindowsSupport.setConsoleMode(WindowsSupport.java:60)
at jline.WindowsTerminal.setConsoleMode(WindowsTerminal.java:208)
at jline.WindowsTerminal.restore(WindowsTerminal.java:95)
at jline.TerminalSupport$1.run(TerminalSupport.java:52)
at jline.internal.ShutdownHooks.runTasks(ShutdownHooks.java:66)
at jline.internal.ShutdownHooks.access$000(ShutdownHooks.java:22)
at jline.internal.ShutdownHooks$1.run(ShutdownHooks.java:47)
From the
http://jline.sourceforge.net/ page my guess is that I have a strict security manager installed on my company's laptop. The original problem was with grails, it just stop working and returned a StackOverflow exception. Using grails -debug and eclipse the jline code
WindowsSupport.getConsoleMode() failed. So some update was applied by the IT folks that is now causing jline to fail :(
So how do I know if my company's laptop has a strict security manager??
The attached code used gradle 2.2.1, just run 'gradle installApp' to create the batch file shown above.