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

Make Lanterna work with Java 1.4.2 #3

Closed
GoogleCodeExporter opened this issue Jun 29, 2015 · 33 comments
Closed

Make Lanterna work with Java 1.4.2 #3

GoogleCodeExporter opened this issue Jun 29, 2015 · 33 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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
Copy link
Author

can you please reply for this post ?

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

@GoogleCodeExporter
Copy link
Author

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

  • Changed title: Make Lanterna work with Java 1.4.2
  • Changed state: Accepted
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

Here's another version, please give it a try

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

Attachments:

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

Looks like java.lang.ProcessBuilder is not in java142.

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

@GoogleCodeExporter
Copy link
Author

I've removed the ProcessBuilder and also the StringBuilder.

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

Attachments:

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

@mabe02 mabe02 self-assigned this Jul 12, 2015
@mabe02
Copy link
Owner

mabe02 commented Jul 12, 2015

I'm going to abandon this issue, it's enough work with Lanterna as it is, keeping a separate 1.4.2 branch is just too much. But feel free to try this on your own, I'll be happy to pull in and release a 1.4.2 version if someone can maintain it.

@mabe02 mabe02 closed this as completed Jul 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants