# Obtaining a license key

The open-source Saxon-HE product does not require any license key. For Saxon-PE and Saxon-EE, however, you need to obtain a license key from Saxonica. You can order a free license key for a 30-day evaluation, or purchase an unrestricted license key, from the Saxonica web site.

From Saxon 9.2, newly issued license keys are compatible across the Java and .NET platforms. The older .NET license keys (named `saxon-license.xml`) are no longer accepted from Saxon 9.3 - if you have such a license key and it has not expired, please contact Saxonica for a replacement.

The license key will arrive in the form of a file named `saxon-license.lic` attached to an email message. Saxon will search for the license key in the following locations:

1. The directory containing the executable Saxon software, that is `saxon9ee.jar` or `saxon9pe.jar` on the Java platform, and `saxon9pe.dll` or `saxon9ee.dll` on the .NET platform. (On .NET, remember that the software may have been moved to the Global Assembly Cache.).

2. On the Java platform only, the directories identified by the environment variable `SAXON_HOME` and `SAXON_HOME/bin`.

3. On the .NET platform only, the installation directory - that is, the directory chosen for installing the software when the installation wizard was run.

4. All directories on the Java class path. When running from the command line, you can set the classpath using the `-cp` option on the `java` command, or via the environment variable `CLASSPATH`. More complex environments might have other ways of building the classpath. In Tomcat, for example, the license file should be treated in the same way as free-standing (unjarred) classes, and placed in the `WEB-INF/classes` directory.

It is also possible to force Saxon to read the license file from a specific location by setting the Configuration property `FeatureKeys.LICENSE_FILE_LOCATION` (a constant representing the string `"http://saxon.sf.net/feature/licenseFileLocation"`). When this property is set, the `Configuration` will immediately attempt to load the specified file, avoiding any subsequent attempt to search for it on the classpath and elsewhere. This mechanism is useful in environments that are otherwise difficult to control: for example configuration properties can be specified as attributes to the `factory` element of Ant's `<xslt>` task.

On the Java platform it is generally simplest to copy the file to the directory in which `saxon9ee.jar` is installed. On .NET it is generally simplest to copy the file to the directory in which `saxon9ee.dll` is installed, and then set the environment variable `SAXON_HOME` to point to this location.

If you acquire Saxon-PE or Saxon-EE as a component of an application with which it has been integrated, the application may activate the software automatically using an OEM license key. In this case you do not need to acquire an individual license key of your own.

Please be aware that the terms and conditions under which license files are issued require you to ensure that it is kept confidential and secure, and is used only on one machine. It must not be copied to other computers, or made available for sharing on a file server.

Next