<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <!-- THIS PAGE IS AUTOMATICALLY GENERATED. DO NOT EDIT. --> <!-- Wed Feb 9 15:17:22 2011 --> <!-- USING HT2HTML 2.0 --> <!-- SEE http://ht2html.sf.net --> <!-- User-specified headers: Title: The Jython Registry --> <head> <title>The Jython Registry</title> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> <meta name="generator" content="HT2HTML/2.0"> <style type="text/css"> body { margin: 0px; } </style> </head> <body bgcolor="#ffffff" text="#000000" marginwidth="0" marginheight="0" link="#0000bb" vlink="#00000" alink="#ff0000"> <!-- start of page table --> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <!-- start of banner row --> <tr> <!-- start of corner cells --> <td width="150" valign="middle" bgcolor="#cccccc" class="corner"> <center> <a href="http://www.jython.org/"> <img border="0" src="./images/jpython-new-small.gif"></a></center> </td> <td width="15" bgcolor="#cccccc"> </td><!--spacer--> <!-- end of corner cells --> <!-- start of banner --> <td width="90%" bgcolor="#cccccc" class="banner"> <!-- start of site links table --> <table width="100%" border="0" cellspacing="0" cellpadding="2" bgcolor="#ffffff"> <tr> <td bgcolor="#cccccc"> <a href="http://www.jython.org/">Home</a> </td> <td bgcolor="#cccccc"> <a href="http://www.python.org/">www.python.org</a> </td> </tr><tr> <td bgcolor="#cccccc"> <a href="http://www.jython.org/download.html">Download</a> </td> <td bgcolor="#cccccc"> <a href="./index.html">Documentation</a> </td> </tr> </table><!-- end of site links table --> </td><!-- end of banner --> </tr><!-- end of banner row --> <tr><!-- start of sidebar/body row --> <!-- start of sidebar cells --> <td width="150" valign="top" bgcolor="#cccccc" class="sidebar"> <!-- start of sidebar table --> <table width="100%" border="0" cellspacing="0" cellpadding="3" bgcolor="#ffffff"> <tr><td bgcolor="#666699"><b><font color="#ffffff"> Documentation </font></b></td></tr> <tr><td bgcolor="#cccccc"> <a href="./index.html">Overview</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="whatis.html">Executive Summary</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="interpreter.html">Invoking Jython</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="registry.html">Jython Registry</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="embedding.html">Embedding</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="compile.html">Compiling Jython from source</a> </td></tr> <tr><td bgcolor="#cccccc"> <tr><td bgcolor="#666699"><b><font color="#ffffff"> Working with Java </font></b></td></tr> <tr><td bgcolor="#cccccc"> <a href="usejava.html">The Basics</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="properties.html">JavaBean Properties</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="jarray.html">Java arrays</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="subclassing.html">Subclassing</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="jythonc.html">Building applets, servlets, beans...</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="jreload.html">Reloading java classes</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="zxjdbc.html">zxJDBC</a> </td></tr> <tr><td bgcolor="#cccccc"> <tr><td bgcolor="#666699"><b><font color="#ffffff"> Python Docs (exits) </font></b></td></tr> <tr><td bgcolor="#cccccc"> <a href="http://www.python.org/doc/tut/tut.html">Python Tutorial</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="http://www.python.org/doc/lib/lib.html">Library Reference</a> </td></tr> <tr><td bgcolor="#cccccc"> <tr><td bgcolor="#666699"><b><font color="#ffffff"> Other </font></b></td></tr> <tr><td bgcolor="#cccccc"> <a href="differences.html">Jython vs. CPython</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="http://www.jython.org/cgi-bin/faqw.py?req=index">Jython FAQ (exit)</a> </td></tr> <tr><td bgcolor="#cccccc"> <a href="http://www.geocrawler.com/archives/3/7017/2000/">List Archives</a> (exit) </td></tr> <tr><td bgcolor="#cccccc"> <a href="http://www.python.org/workshops/1997-10/proceedings/hugunin.html">JPython paper</a> (exit) </td></tr> <tr><td bgcolor="#cccccc"> <tr><td bgcolor="#666699"><b><font color="#ffffff"> Contact </font></b></td></tr> <tr><td bgcolor="#cccccc"> <a href="http://lists.sourceforge.net/lists/listinfo/jython-users">Questions on Jython?<br>jython-users</a> </td></tr> <tr><td bgcolor="#cccccc"> </td></tr> <tr><td bgcolor="#cccccc"> <a href="http://www.python.org/"> <center> <img border="0" src="./images/PythonPoweredSmall.gif"></center> </a> </td></tr> <tr><td bgcolor="#cccccc"> </td></tr> <tr><td bgcolor="#cccccc"> <a href="http://sourceforge.net/"> <center> <img src="http://sourceforge.net/sflogo.php?group_id=12867" width="88" height="31" border="0" alt="SourceForge Logo"></center> </a> </td></tr> </table><!-- end of sidebar table --> </td> <td width="15"> </td><!--spacer--> <!-- end of sidebar cell --> <!-- start of body cell --> <td valign="top" width="90%" class="body"><br> <h3>The Jython Registry</h3> Because there is no good platform independent equivalent of the Windows Registry (or Unix envrionment variables) Java has it's own environment variable namespace. Jython aquires it's namespace from the following three sources (later sources override defaults found in earlier places). <UL> <LI>The Java system properties: typically passed in on the command line as options to the java interpreter. <p><li>The Jython "registry" file, which contains <b><em>prop</em>=<em>value</em></b> pairs. <a href="#finding">See below</a> for the algorithm Jython uses to find the registry file. <p><li>The user's personal registry file, which contains similarly formated prop/value pairs. The user's registry file is at "<tt>user.home</tt>"+"/.jython" <p><LI>Jython properties: Specified on the command line as options to the jython class. See the <a href="interpreter.html">-D option to the interpreter</a>. </ul> <h3>Registry Properties</h3> The following properties are recognized by Jython. There may be others that aren't documented here; consult the comments in registry file for details. <dl> <dt><b>python.path</b> <dd>Equivalent to CPython's <tt>PYTHONPATH</tt> environment variable <dt><b>python.cachedir</b> <dd>The directory to use for caches - currently just package information. This directory must be writable by the user. If the directory is an absolute path, it is used as given, otherwise it is interpreted as relative to <tt>sys.prefix</tt>. <dt><b>python.verbose</b> <dd>Sets the verbosity level for varying degrees of informative messages. Valid values in order of increasing verbosity are "error", "warning", "message", "comment", "debug" <dt><b>python.security.respectJavaAccessibility</b> <dd>Normally, Jython can only provide access to public members of classes. However if this property is set to <tt>false</tt> and <em>you are using Java 1.2</em> then Jython can access non-public fields, methods, and constructors. <dt><b>python.jythonc.compiler</b> <dd>The Java compiler to use with the <tt>jythonc</tt> tool, which now generates Java source code. This should be the absolute path to a Java compiler, or the name of a compiler on your standard PATH. <dt><b>python.jythonc.classpath</b> <dd>Extensions to the standard <tt>java.class.path</tt> property for use with jythonc. This is useful if you use Jikes as your compiler. <dt><b>python.jythonc.compileropts</b> <dd>Options to pass to the Java compiler when using jythonc. <dt><b>python.console</b> <dd>The name of a console class. An alternative console class that supports <a href="http://www.bablokb.de/java/readline.html"> GNU readline</a> can be installed with this property. Jython already include such a console class and it can be enabled by setting this property to <code>org.python.util.ReadlineConsole</code> <dt><b>python.console.readlinelib</b> <dd>Allow a choice of backing implementation for GNU readline support. Can be either <code>GnuReadline</code> or <code>Editline</code>. This property is only used when <b>python.console</b> is set to <code>org.python.util.ReadlineConsole</code>. </dl> <h3><a name="finding">Finding the Registry File</a></h3> The following steps are used to find the Jython registry file, and also to set the Python values for <tt>sys.prefix</tt>. First a <em>root</em> directory is calculated: <ul> <li>If there is a property called <tt>python.home</tt>, this is used as the root directory. <p><li>Otherwise, the property <tt>install.root</tt> is used if it exists. <p><li>If neither of those properties exist, then Jython searches for the file "jython.jar" on the Java classpath, as defined in the system property <tt>java.class.path</tt>. The actual file system isn't searched, only the paths defined on the classpath (one of them must literally include "jython.jar"). </ul> Once the root directory is found, <tt>sys.prefix</tt> and <tt>sys.exec_prefix</tt> are set to this, and <tt>sys.path</tt> has <em>rootdir</em>/Lib appended to it. The registry file used is then <em>rootdir</em>/registry. </td><!-- end of body cell --> </tr><!-- end of sidebar/body row --> </table><!-- end of page table --> </body></html>