question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.lang.IllegalStateException: Unable to create a system terminal

See original GitHub issue

When running the following Kotlin program

object Foo {
    @JvmStatic
    fun main(args: Array<String>) {
        LogManager.getLogManager().getLogger("").level = Level.FINEST

        ProgressBar.wrap(((1..10000).toList()), "Preparing Images").forEach { sleep(10) }
    }
}

in Jetbrains Intellj IDEA (v2018.1), I get the following error:

java.lang.IllegalStateException: Unable to create a system terminal
	at org.jline.terminal.TerminalBuilder.doBuild(TerminalBuilder.java:276)
	at org.jline.terminal.TerminalBuilder.build(TerminalBuilder.java:222)
	at org.jline.terminal.TerminalBuilder.terminal(TerminalBuilder.java:62)
	at me.tongfei.progressbar.ProgressThread.<init>(ProgressThread.java:37)
	at me.tongfei.progressbar.ProgressBar.<init>(ProgressBar.java:51)
	at me.tongfei.progressbar.ProgressBar.<init>(ProgressBar.java:29)
	at me.tongfei.progressbar.wrapped.ProgressBarWrappedIterator.<init>(ProgressBarWrappedIterator.java:18)
	at me.tongfei.progressbar.wrapped.ProgressBarWrappedIterable.iterator(ProgressBarWrappedIterable.java:24)
	at Foo.main(ConvNet.kt:149)
	Suppressed: java.lang.NoClassDefFoundError: com/sun/jna/Platform
		at org.jline.terminal.impl.jna.JnaNativePty.current(JnaNativePty.java:40)
		at org.jline.terminal.impl.jna.JnaSupportImpl.current(JnaSupportImpl.java:16)
		at org.jline.terminal.TerminalBuilder.doBuild(TerminalBuilder.java:320)
		... 8 more
	Caused by: java.lang.ClassNotFoundException: com.sun.jna.Platform
		at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
		at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
		at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
		at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
		... 11 more
	Suppressed: java.lang.UnsupportedOperationException
		at org.jline.terminal.impl.jansi.JansiSupportImpl.current(JansiSupportImpl.java:71)
		at org.jline.terminal.TerminalBuilder.doBuild(TerminalBuilder.java:330)
		... 8 more
	Suppressed: java.io.IOException: Not a tty
		at org.jline.terminal.impl.ExecPty.current(ExecPty.java:44)
		at org.jline.terminal.TerminalBuilder.doBuild(TerminalBuilder.java:339)
		... 8 more
	Caused by: java.io.IOException: Error executing 'tty': not a tty
		at org.jline.utils.ExecHelper.exec(ExecHelper.java:42)
		at org.jline.terminal.impl.ExecPty.current(ExecPty.java:41)
		... 9 more

Preparing Images  10% │██▎                  │  1093/10000 (0:00:12 / 0:01:38) 

The same does not report a stacktrace when being run as a java program in IDEA.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
ctongfeicommented, May 15, 2018

Also in progressbar 0.7.0 the printStackTrace() is suppressed so you would not see the stacktrace anymore.

0reactions
ctongfeicommented, Jan 29, 2020

This should be fixed along with #40. Closed for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Make warning for "Unable to create a system terminal" less ...
IllegalStateException : Unable to create a system terminal at org.jline.terminal.TerminalBuilder.doBuild(TerminalBuilder.java:177) ~[?:?] ...
Read more >
JLine3 "Unable to create a system terminal" after build
I just tried to implement JLine with Jansi, but it throws always the same UnsupportedOperationException referring to org.jline.terminal.impl.
Read more >
JLine falls back to dumb terminal inside IntelliJ IDEA
using JNA or Unable to create a system terminal using JANSI. In the native console (both IDEA and system) the library works just...
Read more >
Java spring-shell-standard cli program failed to perform only ...
WARNING: Creating a dumb terminal java.lang.IllegalStateException: Unable to create a system terminal at org.jline.terminal.TerminalBuilder.
Read more >
org.jline.terminal.TerminalBuilder.builder java code examples
try { final Terminal terminal = TerminalBuilder.builder().system(true).build();
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found