jwill / lanterna

Automatically exported from code.google.com/p/lanterna
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Make Lanterna work with Java 1.4.2 #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

I can only use java 142. Can you please, post the jar file that has class files 
compiled with java142. I am restricted to use Java142 and I am trying out a 
different Operating system. I am trying to use this on IBM 4690. I found this 
useful, because it doesnt use any native DLLs. Please feel free advice. Also, I 
would be grateful if you can compile the source against 142.

Thanks,
Sunil.

Original issue reported on code.google.com by sunildas...@gmail.com on 18 Oct 2011 at 8:17

GoogleCodeExporter commented 9 years ago
The error was Java class could not be loaded. 
java.lang.UnsupportedClassVersionError.

Original comment by sunildas...@gmail.com on 18 Oct 2011 at 8:18

GoogleCodeExporter commented 9 years ago
can you please reply for this post ?

Original comment by sunildas...@gmail.com on 25 Oct 2011 at 2:19

GoogleCodeExporter commented 9 years ago
Hi, sorry, I though Google Code would email me when someone created an issue 
but it apparently doesn't because I didn't see this until now.

About Java 1.4.2, Lanterna is using a fair amount of Java 5.0 functionality, 
but I do see a use for it in older system. I'll try to see if I can make 1.4.2 
branch.

Which functions do you need? Only the terminal/screen? The whole GUI?

Original comment by mab...@gmail.com on 31 Oct 2011 at 12:58

GoogleCodeExporter commented 9 years ago
Hello,

Thanks for replying. Apparently, I thought the same. May be google code
doesnt inform you when a issue is created. So, I tried all fascinating
things like, starring it and stuff.
First of all, I need the whole GUI. Then, let me explain my problem
statement. I had to develop a project, that uses text user interface much
like Java graphics, where you have multiple text boxes (where you can tab
through) and then some buttons. Clicking on that button, would make the
data persistent (save to a file).

My basic problems here are, I use a different operating system (IBM 4690
OS). All the libraries that I found, used native calls and those DLLs would
not work on my OS. So, I was looking for a pure java thing, that could
resolve my problem. According to the documentation you had on google, I
found that your project accomplishes my objective. Do you think so ? Any
other insights are welcome.

Another limitation is, I can only work with java 1.4.2 .If you can make a
branch, that will be really helpful.

Please let me know your insights on this.

Thanks a bunch,
Sunil.

Original comment by sunildas...@gmail.com on 31 Oct 2011 at 4:33

GoogleCodeExporter commented 9 years ago
One quick question, does your Java implementation support sun.misc.Signal 
and/or sun.misc.SignalHandler? I guess the chances are pretty slim, ne?

Lanterna is currently using it to catch the WINCH Unix signal, telling the 
program the terminal size has changed.

Original comment by mab...@gmail.com on 1 Nov 2011 at 1:49

GoogleCodeExporter commented 9 years ago
What jar file is it present in ? Does it come with JDK ? Dont you think it
will work if it comes with JDK ?

Original comment by sunildas...@gmail.com on 1 Nov 2011 at 6:07

GoogleCodeExporter commented 9 years ago
Yeah, it comes with the Sun JRE and it isn't a part of the Java standard but 
several JREs implements them anyway. 

Original comment by mab...@gmail.com on 2 Nov 2011 at 12:12

GoogleCodeExporter commented 9 years ago
I use IBM's version of JRE. So, I am not sure, it would be present and the
OS would support that. Anyways, I would like to give it a try, if you can
give a branch of Java 142. Thanks for all the help.

Original comment by sunildas...@gmail.com on 2 Nov 2011 at 1:30

GoogleCodeExporter commented 9 years ago
I've attached a Java 1.4.2 compiled version of the library. Please give it a 
try and let's try to fix any issues as they come up.

Original comment by mab...@gmail.com on 4 Nov 2011 at 12:01

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for making a branch. I would not get much time to work with that
this weekend. I would probably get back to you by early next week.

Original comment by sunildas...@gmail.com on 4 Nov 2011 at 3:27

GoogleCodeExporter commented 9 years ago
I guess you are using java.util.Queue which is a java 1.5 feature. So, I am
unable to resolve this.

Original comment by sunildas...@gmail.com on 10 Nov 2011 at 6:07

GoogleCodeExporter commented 9 years ago
Ok, I'll try to see if I can eliminate all queues.

Original comment by mab...@gmail.com on 10 Nov 2011 at 11:58

GoogleCodeExporter commented 9 years ago
Ok, here's a new version with no java.util.Queue:s, let me know how it works...

Original comment by mab...@gmail.com on 27 Nov 2011 at 11:36

Attachments:

GoogleCodeExporter commented 9 years ago
I tried working on this..
The following is the stack trace of the error I got.

FXConsole_CreateChildGraphicsVirtualConsole

s_vccreate failed: parentwindow=a00065ac consolefnum=76ae0c08
retcode=8031400e
FXEventTransfer_Run: No display associated with XEvent!!!

Exception in thread "main" java.lang.InternalError: Cannot connect to
default dy
        at sun.awt.X11GraphicsEnvironment.initDisplays(Native Method)

        at
sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:)
        at java.lang.Class.forName1(Native Method)

        at java.lang.Class.forName(Class.java:180)

        at
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnv)
        at java.awt.Font.initializeFont(Font.java:335)

        at java.awt.Font.<init>(Font.java:370)

        at org.lantern.terminal.SwingTerminal.<init>(Unknown Source)

        at org.lantern.terminal.SwingTerminal.<init>(Unknown Source)

        at org.lantern.TerminalFactory$Swing.createTerminal(Unknown Source)

        at org.lantern.TerminalFactory$Default.createTerminal(Unknown
Source)
        at org.lantern.LanternTerminal.<init>(Unknown Source)

        at org.lantern.LanternTerminal.<init>(Unknown Source)

        at org.lantern.LanternTerminal.<init>(Unknown Source)

        at org.lantern.LanternTerminal.<init>(Unknown Source)

        at LanTest.DisplayWindow(LanTest.java:42)

        at LanTest.main(LanTest.java:55)

Let me know if I can change anything else.

Original comment by sunildas...@gmail.com on 5 Dec 2011 at 7:53

GoogleCodeExporter commented 9 years ago
Try creating your LanternTerminal like this:

new LanternTerminal(new TerminalFactory.Common())

Original comment by mab...@gmail.com on 6 Dec 2011 at 2:49

GoogleCodeExporter commented 9 years ago
This is the stack trace now.

Exception in thread "main" java.lang.NoSuchMethodError: java.util.Arrays:
method
        at org.lantern.input.BasicCharacterPattern.hashCode(Unknown Source)

        at java.util.HashMap.hash(HashMap.java:343)

        at java.util.HashMap.put(HashMap.java:461)

        at java.util.HashSet.add(HashSet.java:206)

        at org.lantern.input.InputDecoder.addProfile(Unknown Source)

        at org.lantern.terminal.AbstractTerminal.addInputProfile(Unknown
Source)
        at org.lantern.terminal.CommonTerminal.<init>(Unknown Source)

        at org.lantern.terminal.CommonUnixTerminal.<init>(Unknown Source)

        at org.lantern.TerminalFactory$Common.createTerminal(Unknown
Source)
        at org.lantern.LanternTerminal.<init>(Unknown Source)

        at org.lantern.LanternTerminal.<init>(Unknown Source)

        at org.lantern.LanternTerminal.<init>(Unknown Source)

        at LanTest.main(LanTest.java:21)

Original comment by sunildas...@gmail.com on 6 Dec 2011 at 1:49

GoogleCodeExporter commented 9 years ago
I am sorry, if I forgot telling this. I am working remotely without a
display attached to the machine via SSH. That was my whole problem in going
for something like this. I would have to access remotely. I would not have
a console attached to the machine, instead, I use a terminal emulator.

Original comment by sunildas...@gmail.com on 6 Dec 2011 at 1:56

GoogleCodeExporter commented 9 years ago
Terminal emulator is fine, that's how I use it as well. The stacktrace above is 
for another method that wasn't introduced until Java 5. I'll make a new jar 
tonight.

Original comment by mab...@gmail.com on 6 Dec 2011 at 11:48

GoogleCodeExporter commented 9 years ago
Here's another version, please give it a try

Original comment by mab...@gmail.com on 11 Dec 2011 at 4:11

Attachments:

GoogleCodeExporter commented 9 years ago
Here is the latest exception.
Thanks for all the effort.
Exception in thread "main" java.lang.Error: getenv no longer supported, use proH
        at java.lang.System.getenv(System.java:767)                             
        at org.lantern.terminal.TerminalStatus.<clinit>(Unknown Source)         

Original comment by sunildas...@gmail.com on 13 Dec 2011 at 9:58

GoogleCodeExporter commented 9 years ago
Here is the latest exception.
Thanks for all the effort.
Exception in thread "main" java.lang.Error: getenv no longer supported, use proH
        at java.lang.System.getenv(System.java:767)
        at org.lantern.terminal.TerminalStatus.<clinit>(Unknown Source)

Original comment by sunildas...@gmail.com on 13 Dec 2011 at 9:59

GoogleCodeExporter commented 9 years ago
Thanks for bearing with me. Here's a version without getenv.

Original comment by mab...@gmail.com on 14 Dec 2011 at 3:58

Attachments:

GoogleCodeExporter commented 9 years ago
This is the latest exception

Exception in thread "main" java.lang.NoClassDefFoundError:
java/lang/ProcessBuir
        at org.lantern.terminal.ShellCommand.exec(Unknown Source)

Original comment by sunildas...@gmail.com on 14 Dec 2011 at 7:49

GoogleCodeExporter commented 9 years ago
Looks like java.lang.ProcessBuilder is not in java142.

Original comment by sunildas...@gmail.com on 14 Dec 2011 at 7:50

GoogleCodeExporter commented 9 years ago
I've removed the ProcessBuilder and also the StringBuilder.

Original comment by mab...@gmail.com on 16 Dec 2011 at 3:49

Attachments:

GoogleCodeExporter commented 9 years ago
I guess I am now into the real exceptions:

Exception in thread "main" java.io.IOException: cannot locate program
        at java.lang.FlexOSProcess.doNativeSetup(Native Method)
        at java.lang.FlexOSProcess.runProcess(FlexOSProcess.java:277)
        at java.lang.FlexOSProcess.access$000(FlexOSProcess.java:67)
        at java.lang.FlexOSProcess$1.run(FlexOSProcess.java:160)
        at java.lang.Thread.run(Thread.java:571)

My Operating system is unable to find the program.

Original comment by sunildas...@gmail.com on 19 Dec 2011 at 7:32

GoogleCodeExporter commented 9 years ago
Hmm, this seems to be an exception in JVM, but it probably has something to do 
with the exec:s. First, let me try something I should have tried from the 
beginning; I'll download a 1.4.2 JVM myself and just verify everything's 
working. Then, probably we'll need to guard against these external programs not 
existing.

Original comment by mab...@gmail.com on 20 Dec 2011 at 12:52

GoogleCodeExporter commented 9 years ago
Alright, new year, new attempts!
I've actually downloaded the Sun 1.4.2 JRE and tried it myself, which resulted 
in a number of new API incompatibilities found. Now, even with those fixed, I'm 
not expecting the issue you had above to go away. But anyway, could you please 
try running the org.lantern.test.TerminalTest class in this JAR on your IBM 
JVM, just to be sure?

Original comment by mab...@gmail.com on 14 Jan 2012 at 8:38

Attachments:

GoogleCodeExporter commented 9 years ago
I am sorry, I was little late to get back to this. Yes the same error still
exists.

Exception in thread "main" java.io.IOException: cannot locate program
        at java.lang.FlexOSProcess.doNativeSetup(Native Method)
        at java.lang.FlexOSProcess.runProcess(FlexOSProcess.java:277)
        at java.lang.FlexOSProcess.access$000(FlexOSProcess.java:67)
        at java.lang.FlexOSProcess$1.run(FlexOSProcess.java:160)
        at java.lang.Thread.run(Thread.java:571)

Original comment by sunildas...@gmail.com on 3 Feb 2012 at 6:25

GoogleCodeExporter commented 9 years ago
I returned to this last night and I realized one potential problem. 
At first, I thought it was possible to remove all calls to external programs, 
but I now saw there are three calls I'm not sure we can do without...

These are:
=/bin/stty echo= or =/bin/stty -echo= for enabling/disabling key echoing
=/bin/stty min ##= for setting the minimum characters for a complete read
=/bin/stty -icanon= or =/bin/stty icanon= for enabling special key commands

Can you check if there is a stty program in your IBM environment? It might not 
be in  /bin directory, this is probably causing the error above. Also, see if 
it takes the same parameters as Solaris/Linux does.

Original comment by mab...@gmail.com on 19 Mar 2012 at 12:20

GoogleCodeExporter commented 9 years ago
Very interested in making this work in a Java 1.4.2 environment as well.  I 
have the same issues as what is described in this thread.  Just wondering where 
this was left and if it is possible to have this project work in the 1.4.2 
environment as described here.  thank you!!!

Original comment by radius...@gmail.com on 1 Jul 2014 at 8:50

GoogleCodeExporter commented 9 years ago
I kind of gave up on this, since I didn't the hardware to test it on. Making it 
language compatible with 1.4.2 is one thing, but since we rely on stty in unix 
environment to turn off key echo, line buffering and such, I have no way of 
testing it. Without setting these properties, the library is pretty much 
useless as we can't reliably read input.

Original comment by mab...@gmail.com on 12 Jul 2014 at 2:54