Installing Jython

articles ✒ jython ✒ installing

This page is a brief aid to setting up Jython using Eclipse.

These notes were based heavily on the EclipseNotes page on the Jython wiki.

I'm assuming that you're using Ubuntu 7.04 (feisty), but the instructions will probably work on other OSs with a little tweaking.

Java & Eclipse

First, make sure you have the latest version of Java and Eclipse installed.

sudo apt-get install sun-java6-jdk sun-java6-jre sun-java6-doc

Make sure that Sun's version of Java is used rather than gcj which doesn't work properly with Eclipse.

sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config jar

Download the eclipse version for Java developers and install it.


---TODO---

At this point Jython is now installed, but there are more things you'll need to do to make it usable.

Make a file called jython in ~/bin containing the following:

echo "Starting Jython with args $*"
java -jar ~/workspace/jython/dist/jython.jar $*

Make sure that ~/bin is in your path.

You can do:

export PATH=~/bin:$PATH

on the command-line to add it temporarily.

Installing DistUtils

These instructions were based on information from Stefan Tilkov's blog.

DistUtils is used to install Python packages. Recent versions of CPython comes with DistUtils as standard, but Jython doesn't, so you'll need to download it.

Argh, distutils doesn't work with recent Python features, in particular __doc__ - will look into this further.

comment on this page