Sergix / JTerm

A terminal written in Java for cross-platform compatibility and usage.
https://sergix.github.io/projects/jterm
GNU General Public License v3.0
52 stars 32 forks source link

Latest release not running properly on Eclipse? #115

Closed IshaqIdris closed 6 years ago

IshaqIdris commented 6 years ago

Subject of the issue

Ran JTerm.java as Java application in Eclipse. Got error on line 142 of JTerm.java. Commented out the line and the program ran but no commands worked or were recognised in the terminal.

Your environment

Steps to reproduce

Created new project in Eclipse by downloading source code zip, and ran JTerm.java as java application.

Expected behaviour

Program should have run with commands, as the runnable JAR works fine.

Actual behaviour

With line 142 in JTerm.java the program crashes with a index out of bound error. When commented out the program runs but no commands are recognised in the terminal application.

nanoandrew4 commented 6 years ago

Seems like the command classes aren't being found, and the crash is caused by trying to remove an item from an empty list. @Sergix @DataSecs I have no idea how the classes get loaded, any ideas? May just have to do with using the wrong path to load them or something... There is a note on line 141 that says there is a similar issue on a Linux distro.

Sergix commented 6 years ago

@lshaqldris Try working off of the dev branch rather than the master to see if it runs there. Also, can you post a stacktrace of the error so I can look at it in more detail?

Sergix commented 6 years ago

From what I can tell, that specific line has been changed/removed since the last push to master.

jakers1776 commented 6 years ago

is there any news as to how to make it run?

Sergix commented 6 years ago

Do you have the same issue as @lshaqldris , @jakers821?

jakers1776 commented 6 years ago

I am getting this error:

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:653) at java.util.ArrayList.remove(ArrayList.java:492) at jterm.JTerm.initCommands(JTerm.java:142) at jterm.JTerm.main(JTerm.java:66)

Sergix commented 6 years ago

Yeah, that’s basically the same issue. This means you’re working off of the master branch currently. To run it, switch to the dev branch and everything should be good. If this doesn’t work, please provide another stacktrace. Thanks, and reply back with your result! :smile:

jakers1776 commented 6 years ago

Thanks that worked!

IshaqIdris commented 6 years ago

I moved to the dev branch, the terminal opens now but the commands don't appear to work still? This is what happens: https://pasteboard.co/Hj6RKYb.png And theres no error in the console

jakers1776 commented 6 years ago

Same issue here.

Sergix commented 6 years ago

@IshaqIdris @jakers821 Try the following command from your systems terminal: java -jar [jterm jar file] headless, replacing the [jterm jar file] with the path to where JTerm built on your computer. This will launch JTerm in non-GUI mode. If this successfully works then we will know that your issue is GUI-only, which is what I’m trying to narrow down.

IshaqIdris commented 6 years ago

@Sergix here's what happens when I run the build in headless mode https://pasteboard.co/HjnLWMk.png , is this the expected behaviour?

Sergix commented 6 years ago

No, sadly it’s not haha. It does seem to load correctly, but I suppose command input as a whole is somewhat broken. I’ll look around and see what I can find. I’ll reply back soon, and if at all possible you could perhaps test a couple things for me since I don’t have a Mac. @jakers821 , what OS are you on?

IshaqIdris commented 6 years ago

@Sergix just running the build JAR appears to work https://pasteboard.co/HjnPbyq.png , and yea I don't mind testing some things for you

Sergix commented 6 years ago

Hm ok, that’s odd...

Sergix commented 6 years ago

@IshaqIdris Ok, I just pushed a commit on the dev branch with a couple testing lines. I need you to build and run the program in headless mode. Right under the Licensing information, there should be a TEST LINE (OS): with a true/false value beside it, which I need to know. Then run a command, it can be anything, I just need to see the output of it. If possible a screenshot of the terminal window would be best as you have been doing.

IshaqIdris commented 6 years ago

@Sergix I ran the new commit, the test line prints out true as shown by this screenshot https://pasteboard.co/HjyzlzR.png and also shows the output when I run a command

Sergix commented 6 years ago

Ok, thank you. So I’m trying to figure out, when you enter a command, are you entering ls and then 7?

IshaqIdris commented 6 years ago

@Sergix Nope just ls then enter and the 7 just pops up after that.

Sergix commented 6 years ago

Hm. Ok, well I just pushed another commit for a little more testing. Just run the jar as you have been, in headless mode. Now, when you are typing in the input there will be some output that will appear as you are typing. Try to ignore this and enter the command as usual. Probably best just to type ls and hit enter as you have been doing. Then you can send me the results!

IshaqIdris commented 6 years ago

@Sergix this is the result of running your latest commit https://pasteboard.co/HjHypSq.png

Sergix commented 6 years ago

Huh... Well it seems command input is totally broken on Mac haha. Would you like an invite to our Slack channel? It would make communication easier with fixing this rather than filling up a GitHub issue conversation. All I need to do is send you an email, if that's fine.