> For the complete documentation index, see [llms.txt](https://docs.xplatform.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xplatform.com/get-started/working-with-licenses.md).

# Working With Licenses

## Overview

To use the Talon runtime you must have a license. A license can be supplied to you by Neeve Sales or Neeve Support. Please contact them to obtain your free, evaluation or production license. You will be supplied with a license package containing the *xplatform.lic* license file, credentials to access the Neeve artifact repostitory, instructions on how to install the license and instructions on how to configure your build environment to use the artifact credentials.

## License Installation

You can install your license in your application's runtime environment and/or as an application resource and/or by placing it in the user home folder of the user running the JVM of the platform

### Installing your license in your home directory

Copy your xplatform.lic file to the home directory of the user that runs the X application(s).

If you are just starting with the X Platform, this can be the easiest option to get started.

### **Installing your license as an application resource**

Modify your application build to include xplatform.lic at the resource root i.e. /xplatform.lic (in either a jar or in your classes folder).

### Installing your license in your application's environment

1. Copy your license file to a disk location from which you will run the platform
2. Set one of the following environment variables or Java system properties to point to the *directory* containing license file.

* NVLICLOCATION
* nv.lic.location
* nv\_lic\_location

### A few points to note

1. The xplatform.lic file is a signed file. You must not modify the contents of xplatform.lic or it will be rendered invalid preventing your application from starting.
2. License enforcement is performed when using most libraries distributed with the platform. A failure to find a valid license file will result in System.exit(1) being called, which will terminate the JVM. 3. Precedence of locating a license file is as follows where the first license found is used:
   1. xplatform.lic located in the folder specified by System.getenv('NVLICLOCATION')
   2. xplatform.lic located in the folder specified by System.getenv('nv.lic.location')
   3. xplatform.lic located in the folder specified by System.getenv('nv\_lic\_location')
   4. xplatform.lic located in the folder specified by System.getProperty('NVLICLOCATION')
   5. xplatform.lic located in the folder specified by System.getProperty('nv.lic.location')
   6. xplatform.lic located in the folder specified by System.getProperty('nv\_lic\_location')
   7. xplatform.lic located in the user's home folder (given by System.getProperty("user.home"))
   8. '/xplatform.lic' on the application classpath
   9. A license bundled at a different path specific to a jar provided by Neeve.

{% hint style="info" %}
**xplatform.lic:** Note that at in all of the above cases the license location looks for a file named *xplatform.lic*. The file must not be renamed.
{% endhint %}

### Debugging License Resolution

To diagnose issues in license resolution you can set `-Dnv.license.debug=true` when launching the JVM. Setting this property will dump license resolution trace to `System.err` which will provide information on how your license was (or wasn't) loaded as well as the locations in which the above search steps are performed.

### When running a Talon microservice

When running a Talon microservice, your license information (including its expiration date if applicable) will be printed as part of the startup banner printed to System.out. The banner is only printed if the license was successfully located, otherwise the JVM will have exited before this information would be printed.

```
INFO   | jvm 1    | 2017/08/24 17:08:28 |    [License]
INFO   | jvm 1    | 2017/08/24 17:08:28 |      Issued To: Acme Co
INFO   | jvm 1    | 2017/08/24 17:08:28 |      Type     : Production
INFO   | jvm 1    | 2017/08/24 17:08:28 |      Expires  : Never
INFO   | jvm 1    | 2017/08/24 17:08:28 |      Source   : file:/root/xplatform.lic
```

## License Enforcement

The license enforcement check is done the first time one of the platform's license protected APIs is used. If the license is found to be invalid, the JVM is terminated after printing an error to System.err that will look something like the following:

```
****** X license verification failed "<error message>". Exiting... ******");
```

When running a Talon microservice in an XVM, the XVM will ensure the license check has been done prior to your application being started. If you are using X application libraries outside of an XVM, you may want to ensure that the license check has been completed by calling the [XRuntime.getLicense()](http://build.neeveresearch.com/core/javadoc/LATEST/com/neeve/ci/XRuntime.html#getLicense\(\)) method at an appropriate point in your application lifecycle.

```
com.neeve.ci.XRuntime.getLicense()
```

If the license cannot be found, or the license has been tampered with, the process attempting to use the X Platform will be terminated. It is therefore important for applications that use the X Platform libraries outside of an XVM to ensure that the license is valid in an expeditious fashion.

### License Expiration Warnings

If your license has an expiration date, then starting 1 month before the expiration of your license you will see the following warning emitted to System.err on each startup of your application.

```
WARNING: your X Platform license will expire on <datetime>!
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xplatform.com/get-started/working-with-licenses.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
