1

I tried to install SpiderMonkey 45 in Ubuntu 16.04, but I failed. I refered to SpiderMonkey Build Documentation and finished the make process.

cd js/src
autoconf-2.13

mkdir build_DBG.OBJ
cd build_DBG.OBJ
../configure --enable-debug --disable-optimize
make

After the installation, when I change the directory to ../build_DEBUG.OPT/js/src/shell and type js, the terminal gave me an error:

The program 'js' can be found in the following packages:
 * nodejs
 * rhino
Try: sudo apt install <selected package>

How to solve the problem? Thank you very much.

Aurora0001
  • 13,139
  • 5
  • 50
  • 53
lbs0912
  • 331
  • 1
  • 3
  • 13

1 Answers1

1

Calling js directly looks in your PATH environment variable for an executable called js. Since the directory that you built Spidermonkey in isn't in your path, the executable isn't found, causing an error.

./js expands to <your current directory>/js, which is specific enough for your terminal to find the executable and run it.

See this question for a more general explanation as to why ./executable works but executable doesn't.

Community
  • 1
  • 1
Aurora0001
  • 13,139
  • 5
  • 50
  • 53
  • Don't forget to accept this (and any answers to your other questions) if it's helpful with the green tick icon. – Aurora0001 Dec 03 '16 at 15:37