Enabling readline support with Jython 2.2a on Mac OS X
If you do much work using Java, you're eventually going to try a scripting language that runs on the JVM. My personal favorite is Jython. The only problem is that Jython doesn't have readline support right out of the box. This makes command line usage very frustrating since all the shortcuts that command line users love are missing. Fortunatly, it's relatively easy to enable readline support. Here's the steps for setting jython up with it on Mac OS X:
- Install Fink
- Use fink to install 'readline-java'
- Edit the Jython registry file. Normally, this is located in the same directory that the jython.jar file is in. In case you're wondering, it's named 'registry'. You'll want to add the following lines:
- The last step is to add 'libJavaReadline.jnilib' to the java.library.path. An easy way to do this is to edit your script that launches Jython and add the line:
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/sw/libor you can just copy libJavaReadline.jnilib and java-readline.jar to /Library/Java/Extensions