Home www.python.org
Download Documentation
Documentation
Overview
Executive Summary
Invoking JPython
JPython Registry
Embedding
Compiling JPython from source
 
Working with Java
The Basics
JavaBean Properties
Java arrays
Subclassing
Building applets, servlets, beans...
 
Python Docs (exits)
Python Tutorial
Library Reference
 
Other
JPython vs. CPython
JPython FAQ
List Archives (exit)
JPython paper (exit)
 
Email Us
jpython@python.org
 
  

Compiling JPython

Most users of JPython will never be required to look at the contents of the src directory, or try and recompile any of the files in the org.python package. All of these files have been precompiled in jpython.jar.

For those people who do want to rebuild JPython from the source, for whatever reason, the following offers a few tips to keep in mind.

The source to many of the classes in the org.python.parser package are not distributed with JPython. These classes are produced from the file "python.jjt" using the JavaCC parser generator tool. When rebuilding JPython from source you have two options for generating these classes:

  1. Copy all of the .class files from jpython.jar into src. Then only rebuild those files in packages other than org.python.parser. This is the recommended choice unless you explicitly want to experiment with the JPython grammar/parser.
  2. Get JavaCC 1. Run jjtree on python.jjt, and then run javacc on the resulting python.jj. This should produce all of the required source files to build the org.python.parser package.

The file in src/installer/MakeScriptAction.java is only used by the JPython installer. You should have no need to recompile this file unless you plan to build a new installer for JPython. This file depends on packages from InstallShield Java Edition, and you must have this software installed and in your CLASSPATH before you can rebuild this file.


1JavaCC version 0.7.1 is required. Specifically, newer versions of JavaCC are known to be incompatible with JPython's grammar file. This will be fixed in a later release.