Creating a Jython Project

Although Jython module editing is supported in a simple Eclipse project, the most powerful editing facilities are available only when a module resides in a Jython project. A Jython project knows the source folders that contain Jython modules and it knows where to find Jython libraries used by the modules. It holds onto a system path and a class path that describe where to find modules and jars when a module is launched.

The plug-in comes with a new wizard to create Jython projects and to specify the project's properties.

  1. Select "New Project..." from the toolbar or "New>Project..." from the menubar to open the new wizard.
  2. Press the "Next" button to move to the page to enter the project name and the project location.

  3. Press the "Next" button to move to the page to specify the referenced projects.

    If you have a project for the Jython library, as shown in the picture, and you do not want to specify the Jython library as a library used by the project (see Organizing Projects), tick that project. Tick all other projects of which you need modules in your project.

  4. Press the "Next" button to move to the page to specify the project's source folders and the Jython system path. The system path is used in launch configurations for files in the project.

    The plug-in will determine all source folders in the project. A source folder is a folder that includes at least one .py file. The project itself can be a source folder.

  5. Add source folders using the "Add Folder..." button. Remove folders with the "Remove" button if the folders should not be treated as source folders.
  6. Thick the source folders that should be put on the Jython system path. They will be listed on the "Order" page.
  7. On the "Libraries" page, add library folders with the "Add Folder..." button. Typically, the library folder of your Jython installation is added here if the Jython library is not specified as a referenced project. Therefore, the library folder specified in the preferences will be included automatically.

    Library folders are put on the Jython system path. They are listed on the "Order" page.

  8. On the "Order" page, specify the order of the items on the Jython system path by using the "Up" and "Down" buttons.

  9. Press the "Next" button to move to the page to specify the project's class path. The class path of a project is used when a Jython launch configuration is created for a file in the project. The jars on the project's class path will be added to the class path of a launch configuration.
  10. On the "Libraries" page, add individual JARs to the class path with the "Add External JAR..." button, all JARs in a folder with the "Add JARs in Folder..." button and folders with the "Add Folder..." button.

  11. On the "Order" page, specify the order of the JARs on the class path by using the "Up" and "Down" buttons.

  12. Press "Finish". The Jython project will be built, which means that all libraries and all modules in the source folders are parsed and analyzed. All modules are put in the so-called Jython model. The model holds an abstract representation of the modules that can be used for browsing without the need of having the source files in memory (see the Jython Browsing perspective). During the analysis phaze of the build, the plug-in investigates the source code and adds markers to the module to indicate errors and warnings.

Important note: in the current version, the Jython model is not persistent and a Jython project is not rebuilt automatically when Eclipse is started. Therefore, after starting Eclipse, the user should select the project and choose "Project>Clean" from the menubar. Afterwards, the Jython model is kept up-to-date on resource changes.