Table of Content

1) download jython installer jar

from http://www.jython.org/

2) install jython

in /usr/local in console mode without GUI

/usr/local # java -jar jython-installer-2.5.3.jar --console
Welcome to Jython !

You are about to install Jython version 2.5.3
(at any time, answer c to cancel the installation)
For the installation process, the following languages are available: English, German
Please select your language [E/g] >>> 
Do you want to read the license agreement now ? [y/N] >>> 
Do you accept the license agreement ? [Y/n] >>> 
The following installation types are available:
  1. All (everything, including sources)
  2. Standard (core, library modules, demos and examples, documentation)
  3. Minimum (core)
  9. Standalone (a single, executable .jar)
Please select the installation type [ 1 /2/3/9] >>> 
Do you want to exclude parts from the installation ? [y/N] >>> 
Please enter the target directory >>> /usr/local/jython
Please enter the java home directory (empty for using the current java runtime) >>> 
Your java version to start Jython is: Oracle Corporation / 1.7.0_21
Your operating system version is: Linux / 3.4.6-2.10-desktop
Summary:
  - mod: true
  - demo: true
  - doc: true
  - src: true
  - JRE: /usr/java/jdk1.7.0_21/jre
Please confirm copying of files to directory /usr/local/jython [Y/n] >>> 
 10 %
 20 %
 30 %
 40 %
 50 %
 60 %
 70 %
 80 %
 90 %
Generating start scripts ...
 100 %
Do you want to show the contents of README ? [y/N] >>> 
Congratulations! You successfully installed Jython 2.5.3 to directory /usr/local/jython.

3) run jython

dreamcloud-opensuse:/usr/local # cd jython/
dreamcloud-opensuse:/usr/local/jython # ls
ACKNOWLEDGMENTS       Doc                 LICENSE_CPython.txt  README.txt  extlibs  jython.jar  tests
CoreExposed.includes  LICENSE.txt         Lib                  bin         grammar  registry
Demo                  LICENSE_Apache.txt  NEWS                 build.xml   jython   src

dreamcloud-opensuse:/usr/local/jython # java -jar jython.jar 
*sys-package-mgr*: processing new jar, '/usr/local/jython/jython.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_21/jre/lib/resources.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_21/jre/lib/rt.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_21/jre/lib/jsse.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_21/jre/lib/jce.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_21/jre/lib/charsets.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_21/jre/lib/jfr.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_21/jre/lib/ext/sunjce_provider.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_21/jre/lib/ext/sunec.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_21/jre/lib/ext/localedata.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_21/jre/lib/ext/sunpkcs11.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_21/jre/lib/ext/zipfs.jar'
*sys-package-mgr*: processing new jar, '/usr/java/jdk1.7.0_21/jre/lib/ext/dnsns.jar'
Jython 2.5.3 (2.5:c56500f08d34+, Aug 13 2012, 14:48:36) 
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.7.0_21
Type "help", "copyright", "credits" or "license" for more information.
>>> 2+3
5
>>> import os
>>> os.path

4) create alias for jython in bash profile

add alias to /etc/bash.bashrc

alias jython='java -jar /usr/local/jython/jython.jar'

5) start jython

$ jython   // shell mode
$ jython test.py   // run jython script