Getting started
In this section we'll walk through each of the steps for downloading, installing, and verifying Jython on your development system.
You can download Jython 2.1 from the Jython home page. You'll find easy-to-follow download instructions on the download page.
As previously mentioned, this tutorial is based on the current stable Jython level, which is version 2.1. More advanced development levels may also be available from the Jython home page.
Installing Jython is simple: just execute the class file you've downloaded from the Jython homepage. Assuming that you have a JRE installed and have the downloaded class file in your current directory (C:\ in the examples below) the following command will install Jython (note that <java_home> is the directory the JRE is installed in):
C:\><java_home>\bin\java jython-21 |
Please follow the install application's prompts. I recommend you select the defaults, and that you select c:\Jython-2.1 as the destination directory.
To verify that Jython is installed, enter the command:
C:\>dir c:\Jython-2.1 |
The result should be a listing like this one:
Volume in drive C is C_DRIVE
Volume Serial Number is ????-????
Directory of C:\Jython-2.1
--/--/---- --:--- <DIR> .
--/--/---- --:--- <DIR> ..
--/--/---- --:--- 1,873 ACKNOWLEDGMENTS
--/--/---- --:--- <DIR> cachedir
--/--/---- --:--- <DIR> com
--/--/---- --:--- <DIR> Demo
--/--/---- --:--- <DIR> Doc
--/--/---- --:--- <DIR> installer
--/--/---- --:--- 428 jython.bat
--/--/---- --:--- 719,950 jython.jar
--/--/---- --:--- 272 jythonc.bat
--/--/---- --:--- <DIR> Lib
--/--/---- --:--- 7,184 LICENSE.txt
--/--/---- --:--- 18,178 NEWS
--/--/---- --:--- <DIR> org
--/--/---- --:--- 651 README.txt
--/--/---- --:--- 4,958 registry
--/--/---- --:--- <DIR> Tools
--/--/---- --:--- 224,493 Uninstall.class
9 File(s) 977,987 bytes
? Dir(s) ??? bytes free
|
The final step is to ensure that Jython is configured. To run Jython, start by entering the command:
C:\>c:\jython-2.1\jython |
The command should result in an introduction similar to this one:
Jython 2.1 on java1.4.1_01 (JIT: null) Type "copyright", "credits" or "license" for more information. |
Finally, we'll exit Jython. At the Jython prompt, enter the following command:
>>> import sys; sys.exit() |
Alternatively, you could just press Ctrl+C two times.
There is just one last thing you should know before we close this section
on getting started. You can eliminate the need to specify
the Jython command path (<d>:\jython-2.1)
by adding it to your PATH variable. Now you can just
type jython at the command prompt.



