0

I was following instructions here https://github.com/cs50/spl

  • apt-get install -y build-essential git openjdk-7-jdk
  • git clone git@github.com:cs50/spl.git
  • cd spl
  • make
  • sudo make install

make

gcc -o build/tests/TestStanfordCSLib build/obj/TestStanfordCSLib.o -    Lbuild/lib -lcs -lm
javac -d build/classes -classpath java/lib/acm.jar -sourcepath java/src \
java/src/stanford/spl/JavaBackEnd.java
jar cf build/lib/spl.jar . . .

sudo make install

javac -d build/classes -classpath java/lib/acm.jar -sourcepath java/src \
java/src/stanford/spl/JavaBackEnd.java
/bin/bash: jar: command not found
Makefile:308: recipe for target 'spl.jar' failed
make: *** [spl.jar] Error 127

Does someone know how to fix it?

Any advice will be helpful ;)

3
  • Interesting! So apparently the jar command worked in the make step, but not in the make install step? What happens when you run which jar? – Kareem Mar 6 '17 at 20:49
  • /usr/local/java/jdk1.8.0_121/bin/jar @Kareem – wingedRuslan Mar 7 '17 at 22:36
  • Hm, not really sure what's wrong! I could take a closer look via Team Viewer. Just have it installed, and email me your Team Viewer ID and password, if you'd like to! – Kareem Mar 7 '17 at 22:42
1

Just for reference, the problem was that the OP installed Oracle's JDK manually, and the directories containing the JDK's programs were not on root's PATH. That's why sudo make install failed, when it was trying to use jar.

There's more than one solution to this problem, including putting these directories on root's PATH, or softlinking the program's to somewhere on PATH already, or simply installing openjdk using

sudo apt-get install openjdk-7-jdk

per SPL's readme!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .