Running on windows

836 views
Skip to first unread message

John Haigh

unread,
Oct 1, 2016, 8:27:42 PM10/1/16
to lanterna-discuss
Hello,

Is there documentation somewhere on how to run on windows? 

I took one of the samples that comes with lanterna and this runs fine on MacOSX but when I run on windows I get the following error:


C:\dev>java -cp lanterna-3.0.0-SNAPSHOT.jar com.Test

Exception in thread "main" java.io.IOException: Cannot run program "/bin/stty":

CreateProcess error=2, The system cannot find the file specified

        at java.lang.ProcessBuilder.start(Unknown Source)

        at com.googlecode.lanterna.terminal.ansi.UnixLikeTTYTerminal.exec(UnixLi

keTTYTerminal.java:169)

        at com.googlecode.lanterna.terminal.ansi.UnixLikeTTYTerminal.saveTermina

lSettings(UnixLikeTTYTerminal.java:117)

        at com.googlecode.lanterna.terminal.ansi.UnixLikeTerminal.aquire(UnixLik

eTerminal.java:79)

        at com.googlecode.lanterna.terminal.ansi.UnixLikeTTYTerminal.realAquire(

UnixLikeTTYTerminal.java:87)

        at com.googlecode.lanterna.terminal.ansi.UnixLikeTTYTerminal.<init>(Unix

LikeTTYTerminal.java:78)

        at com.googlecode.lanterna.terminal.ansi.CygwinTerminal.<init>(CygwinTer

minal.java:63)

        at com.googlecode.lanterna.terminal.DefaultTerminalFactory.createCygwinT

erminal(DefaultTerminalFactory.java:293)

        at com.googlecode.lanterna.terminal.DefaultTerminalFactory.createWindows

Terminal(DefaultTerminalFactory.java:288)

        at com.googlecode.lanterna.terminal.DefaultTerminalFactory.createTermina

l(DefaultTerminalFactory.java:98)

        at com.Test.main(Test.java:16)

Caused by: java.io.IOException: CreateProcess error=2, The system cannot find th

e file specified

        at java.lang.ProcessImpl.create(Native Method)

        at java.lang.ProcessImpl.<init>(Unknown Source)

        at java.lang.ProcessImpl.start(Unknown Source)

        ... 11 more



Working under macosx.


Thanks,

John Haigh

AvL42

unread,
Oct 2, 2016, 8:24:50 AM10/2/16
to lanterna-discuss
On Windows, the command line window is not even a poor imitation of a "terminal".

If you install Cygwin, then you get something at least slightly resembling a terminal, but it probably
still won't work well. You could, however, help us to beef up cygwin support on Windows until it actually
works.

Without Cygwin, you can try to change the invocation to something like:
C:\dev> start java -cp lanterna-3.0.0-SNAPSHOT.jar com.Test
and if you're lucky, it will open a separare window for Test. I think
it should work, but I don't have Windows here, so can't test.

Nick Hunter

unread,
Sep 12, 2017, 9:30:42 PM9/12/17
to lanterna-discuss
Hey,


So I am running the attached program. It was a example. I can run this via netbeans8.2. I double click it and run it. I cannot run it via Maven. See images for information on. All was ran won Windows 7. I would like to know the cmd issue too.
LantNoMVNNoWorks.png
LantNoMVNWorks.png

Andreas Leitgeb

unread,
Sep 13, 2017, 2:25:56 AM9/13/17
to lanterna...@googlegroups.com
when in cmd console, use javaw instead of java


--
Det här meddelandet skickas till dig eftersom du prenumererar på ett ämne i gruppen "lanterna-discuss" i Google Grupper.
Sluta prenumerera på det här ämnet genom att besöka https://groups.google.com/d/topic/lanterna-discuss/ajb_SYSv9SY/unsubscribe.
Om du vill sluta prenumerera på den här gruppen och på alla ämnen i den skickar du ett e-postmeddelande till lanterna-discuss+unsubscribe@googlegroups.com.
Fler alternativ finns på https://groups.google.com/d/optout.

Martin Berglund

unread,
Sep 24, 2017, 8:06:27 AM9/24/17
to lanterna...@googlegroups.com
For pure terminal support under Windows (even Cygwin, I'm pretty sure) native bindings will be necessary. It seems just not possible to do some of the required low-level terminal operations properly with only java. There are some experimental native Windows and Linux bindings in a sub-module for lanterna, but it's only partially functional.

The Swing terminal emulator should be functional though. Perhaps the auto-detection requires you to run javaw.exe instead of java.exe when launching, as Andreas is pointing out above. You could also quite easily hard-code the program to use SwingTerminalFrame whenever running on Windows.

--
Det här meddelandet skickas till dig eftersom du prenumererar på gruppen "lanterna-discuss" i Google Grupper.
Om du vill sluta prenumerera på den här gruppen och inte längre få någon e-post från den skickar du ett e-postmeddelande till lanterna-discuss+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages