21
votes
  1. I downloaded jython_installer-2.5.2.jar from jython.org.
  2. Opened the terminal and gave this command:-

java -jar jython_installer-2.5.2.jar

  1. It was installed in a folder named jython2.5.2 in the home directory
  2. But whenever I open the terminal and give the command jython in the terminal I am shown a message saying Jython is not installed.

How can I fix this problem?

I can install Jython using sudo apt-get install jython, but the Jython in Ubuntu repositories is 2.2.1 and I want the new version..

3
Please read the description of tags before applying them. The tags "linux" and "shell" were wrong. I think that at least the "linux" description changed since the writing of the question though, so maybe that was not your fault. - Ulrich Eckhardt

3 Answers

33
votes

To install Jython with super user privileges:

sudo java -jar jython_installer-2.5.2.jar

Select /usr/local/lib/jython, then create a symbol link of Jython to /usr/local/bin:

sudo ln -s /usr/local/lib/jython/bin/jython /usr/local/bin/jython
13
votes

When you type in jython, the shell looks for a program with that name in the PATH. You should either call the program with its full path:

# ~ is an abbreviation for your homedir
~/jython2.5.2/bin/jython

or add the directory with the executable to your PATH:

PATH=$HOME/jython2.5.2/bin:$PATH

If you want the latter to persist across terminal sessions, add it to your ~/.bashrc.

2
votes

If you have ubuntu 19.04, you can install with apt

sudo apt install jython