21
  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..

Ulrich Eckhardt
  • 16,572
  • 3
  • 28
  • 55
rubicondude
  • 605
  • 2
  • 7
  • 10
  • 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 Jul 29 '18 at 07:43

3 Answers3

33

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
Stewart
  • 17,616
  • 8
  • 52
  • 80
Ning Sun
  • 2,145
  • 1
  • 19
  • 24
  • yeah!I read your blog on that and fixed it.. thanks a tonne ! – rubicondude May 02 '11 at 12:14
  • When I run jython from the bin folder it doesn't start up. Do I need to change the permissions? Or do I have to always run ./jython – pitchblack408 Sep 09 '14 at 16:52
  • 1
    I am using ubuntu 15.04 and I can install jython directly by sudo apt-get install jython – Chinmaya B Sep 09 '15 at 15:43
  • I have the same problem as the poster and Sun Ning's solution didn't help. Despite running sudo java -jar ... my /usr/local/lib does not contain jython – Adam Jan 23 '16 at 05:20
13

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.

Fred Foo
  • 355,277
  • 75
  • 744
  • 836
2

If you have ubuntu 19.04, you can install with apt

sudo apt install jython