gatech-csl / jes

The Jython Environment for Students allows students to write Jython programs that can manipulate pictures, sounds, and videos.
http://mediacomputation.org/
59 stars 38 forks source link

jes.sh: 48: jes.sh: Syntax error: "elif" unexpected (expecting "then") #132

Open mirfan899 opened 4 years ago

mirfan899 commented 4 years ago

Can't run JES on Ubuntu 18.04 from release Linux package. https://github.com/gatech-csl/jes/releases/download/6.0/jes-6.0-linux.tar.gz.zip

getting this error

sh jes.sh
: not foundjes.sh: 
: not foundjes.sh: 
jes.sh: 48: jes.sh: Syntax error: "elif" unexpected (expecting "then")
mirfan899 commented 4 years ago

Also it shows syntax error

bash -n jes.sh 
jes.sh: line 48: syntax error near unexpected token `elif'
'es.sh: line 48: `elif ! test -z "$JAVA_HOME"; then
mjguzdial commented 4 years ago

Try

./jes.sh

Mark Guzdial, mjguz@umich.edu

On Tue, Apr 21, 2020 at 10:06 AM Muhammad Irfan notifications@github.com wrote:

Also it shows syntax error

bash -n jes.sh jes.sh: line 48: syntax error near unexpected token elif''es.sh: line 48:elif ! test -z "$JAVA_HOME"; then

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gatech-csl/jes/issues/132#issuecomment-617202545, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBN7JRPDWK4HI2BKMI4TKTRNWR67ANCNFSM4MNKZ3XQ .

mirfan899 commented 4 years ago

Another issue pop up

./jes.sh 
-bash: ./jes.sh: /bin/sh^M: bad interpreter: No such file or directory
mirfan899 commented 4 years ago

It seems shell script has DOS/Windows style line endings (CR LF)

mirfan899 commented 4 years ago

This error is removed by the following link https://askubuntu.com/questions/304999/not-able-to-execute-a-sh-file-bin-bashm-bad-interpreter

but more errors popped up.

./jes_linux.sh
./jes_linux.sh: 1: ./jes_linux.sh: /usr/libexec/PlistBuddy: not found
./jes_linux.sh: 1: ./jes_linux.sh: /usr/libexec/PlistBuddy: not found
./jes_linux.sh: 1: ./jes_linux.sh: /usr/libexec/java_home: not found
./jes_linux.sh: 58: ./jes_linux.sh: osascript: not found
jlmayfield commented 3 years ago

I'm seeing this exact problem on Pop_OS 20.04 (so basically Ubuntu 20.04). @mirfan899 Did you ever get past those errors?

jlmayfield commented 3 years ago

I was able to get JES to launch on PopOS 20.04 by doing the following: 1) Run dos2unix on jes.sh to address the Dos style line endings mentioned in https://github.com/gatech-csl/jes/issues/132#issuecomment-617288680 2) Remove or comment out several lines in jes.sh that seem to be referencing Mac OS specific conventions or options. Specifically lines 20, 23, 26, and 128. 3) Modify line 51 to correctly point to a local installation of openjdk8 (JAVA="/usr/bin/java" on my system). You could probably avoid this by setting JES_JAVA_HOME in the local environment but the existing line was, I think, Mac specific. 4) Remove several lines from the final launch command. Specifically the two that start with -Xdock and the one that starts with -Dapple

As near as I can tell this script is meant for an apple system. Several of the lines I removed reference PListBuddy which is, I think, apply only. It doesn't seem to be setup for Ubuntu so I'm not sure which linux distro it was tested on. I haven't run any programs on JES and I'm not sure that my fixes are much more than a quick hack so I'm hesitant to submit a PR or anything.

mirfan899 commented 3 years ago

Yes, I've commented out a few lines to handle the issue.