Unable to execute .sh file

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to execute .sh file

rd9911
I am using Ubuntu 20.04 LTS and unable to execute .sh file.

I downloaded and unziped all necessary files: nand2tetris, Opendjdk java 8 and made HardwareSimulator.sh file executable after moving it to /Desktop dir. I tried all answers in [this](https://askubuntu.com/questions/38661/how-do-i-run-sh-scripts) link but no fortune.

After a command `/bin/bash -x HardwareSimulator.sh`it shows:
+ unset CDPATH
++ test -L HardwareSimulator.sh
++ echo HardwareSimulator.sh
+ script=HardwareSimulator.sh
+ dir=/home/rd9911/Desktop/nand2tetris/tools
++ dirname HardwareSimulator.sh
+ cd .
+ '[' '(' 0 -gt 1 ')' -o '(' '' = -h ')' -o '(' '' = --help ')' ']'
+ '[' 0 -eq 0 ']'
+ java -classpath :bin/classes:BuiltIn:bin/lib/Hack.jar:bin/lib/HackGUI.jar:bin/lib/Simulators.jar:bin/lib/SimulatorsGUI.jar:bin/lib/Compilers.jar HardwareSimulatorMain

What am I doing wrong?
Reply | Threaded
Open this post in threaded view
|

Re: Unable to execute .sh file

ivant
Try executing just the last line (without the +) and tell us what happens. If there is an error message, please paste it here.

java -classpath :bin/classes:BuiltIn:bin/lib/Hack.jar:bin/lib/HackGUI.jar:bin/lib/Simulators.jar:bin/lib/SimulatorsGUI.jar:bin/lib/Compilers.jar HardwareSimulatorMain
Reply | Threaded
Open this post in threaded view
|

Re: Unable to execute .sh file

rd9911
Nothing is happened. Typed as root user too but no change.

Here is a picture:
Reply | Threaded
Open this post in threaded view
|

Re: Unable to execute .sh file

ivant
You don't need to run any of these as root.

Can you run
java -version
and paste the results?
Reply | Threaded
Open this post in threaded view
|

Re: Unable to execute .sh file

rd9911
it outputs literally nothing
Reply | Threaded
Open this post in threaded view
|

Re: Unable to execute .sh file

ivant
It looks like that the problem is with your java installation.

I don't have Ubuntu 20.04 at the moment. Here is a blog post I found on how to install java there: https://linoxide.com/ubuntu-how-to/install-java-ubuntu-20-04/. I advise you to go with the OpenJDK 11 version.
Reply | Threaded
Open this post in threaded view
|

Re: Unable to execute .sh file

rd9911
Yes, it turned out that the problem was with my java. thank you!
Reply | Threaded
Open this post in threaded view
|

Re: Unable to execute .sh file

ivant
I'm glad you were able to fix it.