Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminal On Windows #546

Closed
BeanVortex opened this issue May 17, 2021 · 4 comments
Closed

Terminal On Windows #546

BeanVortex opened this issue May 17, 2021 · 4 comments

Comments

@BeanVortex
Copy link

Hi
Code works fine on Linux but on windows it can't find Terminal.
Error:

Exception in thread "main" java.io.IOException: To start java on Windows, use javaw! (see https://github.com/mabe02/lanterna/issues/335 ) at com.googlecode.lanterna.terminal.DefaultTerminalFactory.createWindowsTerminal(DefaultTerminalFactory.java:457) at com.googlecode.lanterna.terminal.DefaultTerminalFactory.createHeadlessTerminal(DefaultTerminalFactory.java:140) at com.googlecode.lanterna.terminal.DefaultTerminalFactory.createTerminal(DefaultTerminalFactory.java:113) at TypeConsole.App.main(App.java:25) Caused by: java.io.IOException: Cannot run program "stty.exe": CreateProcess error=2, The system cannot find the file specified at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1142) at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073) at com.googlecode.lanterna.terminal.ansi.UnixLikeTTYTerminal.exec(UnixLikeTTYTerminal.java:158) at com.googlecode.lanterna.terminal.ansi.CygwinTerminal.runSTTYCommand(CygwinTerminal.java:94) at com.googlecode.lanterna.terminal.ansi.UnixLikeTTYTerminal.saveTerminalSettings(UnixLikeTTYTerminal.java:113) at com.googlecode.lanterna.terminal.ansi.UnixLikeTerminal.acquire(UnixLikeTerminal.java:86) at com.googlecode.lanterna.terminal.ansi.UnixLikeTTYTerminal.realAcquire(UnixLikeTTYTerminal.java:86) at com.googlecode.lanterna.terminal.ansi.UnixLikeTTYTerminal.<init>(UnixLikeTTYTerminal.java:77) at com.googlecode.lanterna.terminal.ansi.CygwinTerminal.<init>(CygwinTerminal.java:63) at com.googlecode.lanterna.terminal.DefaultTerminalFactory.createCygwinTerminal(DefaultTerminalFactory.java:463) at com.googlecode.lanterna.terminal.DefaultTerminalFactory.createWindowsTerminal(DefaultTerminalFactory.java:455) ... 3 more Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified at java.base/java.lang.ProcessImpl.create(Native Method) at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:483) at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:158) at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1109) ... 13 more

By using javaw it opens a SwingTerminalFrame window which many functionalities are not working

@avl42
Copy link
Contributor

avl42 commented May 17, 2021 via email

@BeanVortex
Copy link
Author

Terminal applications, such as what Lanterna helps one to create, aren't natively "at home" in Windows... One solution are SwingTerminal apps (with javaw.exe). You might want to help add the missing bits to it. Another would be installing Cygwin and use Lanterna in Cygwin terminals. Another would be the WindowsTerminal (using JNA, iirc), which would need some active developers/testers to get into shape. For a starter, look at the tree "native-integration" and try to get that into your build environment. (I can't help much there - my own computers are a "Window"-less environment.)

OK. thanks

@rednoah
Copy link
Contributor

rednoah commented May 26, 2021

@DarkDeveloper-Plant Have you tried 3.2.0-alpha1 yet? I've been using the JNA for a year and it works well for my use cases:
#422

@rednoah
Copy link
Contributor

rednoah commented May 26, 2021

The JNA implementation is production-ready as far as I can say, and definitely preferable to the To start java on Windows, use javaw! error message. I'd rather get a "can't load JNA" error message, and then go ahead and add JNA to the classpath.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants