﻿# How to enter the PVS\-Studio license and what is the next move

PVS\-Studio is a static analyzer for C, C\+\+, C\#, Java, Go, JS and TS code\. You can run the analyzer on Windows, Linux, and macOS\. It is necessary to activate the license before using the analyzer\. The product is used in various environments, including IDEs and local or cloud\-based CI/CD systems\. Find the section relevant to your setup and follow the corresponding instructions\.

**Note\.** Follow these steps after installing the analyzer\. You can download it on this [page](https://pvs-studio.com/en/pvs-studio/download/)\.

## What the license includes

The license consists of the analyzer username associated with the license key and a 16\-character license key of the "XXXX\-XXXX\-XXXX\-XXXX" format\. If you do not have a license, you can request a [trial](https://pvs-studio.com/en/pvs-studio/try-free/)\.

Here is an example of how the license information may look like:

```cpp
JohnSmith           <--- Username associated with the key
ASD1-DAS3-5KK3-LODR <--- License key
```

## License activation via the GUI

### PVS\-Studio Installer

You can enter the license during the PVS\-Studio installation\. The installation wizard prompts you to request a license or enter an existing one\.

![EnterLicense/image1.png](https://import.viva64.com/docx/blog/EnterLicense/image1.png)

Choose **I have a license and want to activate it **and click **Next**:

![EnterLicense/image2.png](https://import.viva64.com/docx/blog/EnterLicense/image2.png)

Enter the username associated with the key in the **License Name** field and a license key in the **License Key** field\. If the credentials are valid, you get a message with the license information\.

### Microsoft Visual Studio

In the Visual Studio menu, open **Extensions \>** **PVS\-Studio \> Options **\(**PVS\-Studio \> Options** for Visual Studio 2015 and earlier\):

![EnterLicense/image3.png](https://import.viva64.com/docx/blog/EnterLicense/image3.png)

Navigate to the **PVS\-Studio \> Registration** tab in the menu:

![EnterLicense/image4.png](https://import.viva64.com/docx/blog/EnterLicense/image4.png)

Enter the username associated with the key in the **Name** field and the license key in the **LicenseKey** field\. If credentials are valid, you get a message with the license information:

![EnterLicense/image5.png](https://import.viva64.com/docx/blog/EnterLicense/image5.png)

If credentials are invalid, you get the following message:

![EnterLicense/image6.png](https://import.viva64.com/docx/blog/EnterLicense/image6.png)

### JetBrains IDEs \(IntelliJ Platform\)

To enter the analyzer license, open any project and then the IDE settings:

![EnterLicense/image7.png](https://import.viva64.com/docx/blog/EnterLicense/image7.png)

Navigate to the **PVS\-Studio \> Registration** tab in the opened window\.

Enter the username in the **Name** field and the license key in the **License Key** field\.

![EnterLicense/image8.png](https://import.viva64.com/docx/blog/EnterLicense/image8.png)

If credentials are valid, **Invalid License** will be replaced with **Valid License** and the license expiration date will appear in the **Expires** field\. Click **Apply** or **OK **to confirm and save the license info\.

### C and C\+\+ Compiler Monitoring UI

To enter the license, go to the utility menu by selecting **Tools \> Options \> Registration**:

![EnterLicense/image9.png](https://import.viva64.com/docx/blog/EnterLicense/image9.png)

Enter the username associated with the key in the **Name** field and the license key in the **LicenseKey** field\. If credentials are valid, you get a message with the license information:

![EnterLicense/image10.png](https://import.viva64.com/docx/blog/EnterLicense/image10.png)

If credentials are invalid, you get the following message:

![EnterLicense/image11.png](https://import.viva64.com/docx/blog/EnterLicense/image11.png)

### Visual Studio Code

To enter the license in Visual Studio Code, open **View \> Command Palette**\.

![EnterLicense/image12.png](https://import.viva64.com/docx/blog/EnterLicense/image12.png)

Enter "PVS\-Studio: Show settings" in the search bar and click\.

![EnterLicense/image13.png](https://import.viva64.com/docx/blog/EnterLicense/image13.png)

Select the **License** tab in the opened window\.

![EnterLicense/image14.png](https://import.viva64.com/docx/blog/EnterLicense/image14.png)

Enter the username associated with the key in the **User name** field and the license key in the **Key** field\. If credentials are valid, you get a message with the license information:

![EnterLicense/image15.png](https://import.viva64.com/docx/blog/EnterLicense/image15.png)

### Qt Creator

To enter the license in Qt Creator, open **Analyze \> PVS\-Studio \> Options\.\.\.**

![EnterLicense/image16.png](https://import.viva64.com/docx/blog/EnterLicense/image16.png)

Next, click the **PVS\-Studio** tab and open the **Registration** tab\. Enter the username associated with the key in the **Name** field and your license key in the **License Key** field\. If credentials are valid, you get a message with the license information:

![EnterLicense/image17.png](https://import.viva64.com/docx/blog/EnterLicense/image17.png)

If credentials are invalid, you get the following message:

![EnterLicense/image18.png](https://import.viva64.com/docx/blog/EnterLicense/image18.png)

Click **Apply** or **OK** to confirm and save the entered license\.

## License activation via the command line

### Windows

If you cannot enter the license in the GUI, use the analyzer in a special mode on Windows\. 

The command line may look like this:

```cpp
PVS-Studio_Cmd.exe credentials --userName %USER_NAME% ^
                               --licenseKey %LICENSE_KEY%
```

Replace the `USER_NAME` variable with the username associated with the key, and the `LICENSE_KEY` variable with the license key\.

When you run PVS\-Studio this way, the analyzer writes the license to the settings file located in the default directory: `%APPDATA%/PVS-Studio/Settings.xml `\. If the settings file does not exist, it will be created\. Use the `--settings` flag to specify the path to the settings file in a non\-default location\.

Use the `--licInfo` flag to get current license information\.

### Linux/macOS

If you cannot enter the license in the GUI when running the analyzer on Linux/macOS platforms, use the special `pvs-studio-analyzer` utility\. 

The command line on Linux/macOS may look like this:

```cpp
pvs-studio-analyzer credentials ${USER_NAME} ${LICENSE_KEY}
```

Replace the `USER_NAME` variable with the username associated with the key, and the `LICENSE_KEY` variable with the license key\.

When you run PVS\-Studio this way, the analyzer writes the license to the settings file located in the default directory: `~/.config/PVS-Studio/PVS-Studio.lic`\. If the settings file does not exist, it will be created\.

Use the `lic-info` flag to get current license information:

```cpp
pvs-studio-analyzer lic-info
```

### Java analyzer

PVS\-Studio Java can be installed independently from the other components of PVS\-Studio, so you can also activate the license using plugins for build systems\.

If you use Maven, the command line for entering the license may look like this: 

```cpp
mvn pvsstudio:pvsCredentials "-Dpvsstudio.userName=${USER_NAME}" \
                             "-Dpvsstudio.licenseKey=${LICENSE_KEY}"
```

If you use Gradle, the license can be activated via the following command:

```cpp
./gradlew pvsCredentials "-Ppvsstudio.userName=${USER_NAME}" \
                         "-Ppvsstudio.licenseKey=${LICENSE_KEY}"
```

When using the Java analyzer core from the console, you can activate the license via this command:

```cpp
java -jar pvs-studio.jar --activate-license --user-name $USER_NAME \
                                            --license-key $LICENSE_KEY
```

Replace the `USER_NAME` variable with the username associated with the key,, and the `LICENSE_KEY` variable with the license key\.

## Next steps

You can read more about the analyzer on the following pages:

1. [Getting acquainted with the PVS\-Studio static code analyzer on Windows](https://pvs-studio.com/en/docs/manual/0007/)
1. [How to run PVS\-Studio on Linux and macOS \(C, C\+\+\)](https://pvs-studio.com/en/docs/manual/0036/)
1. [PVS\-Studio C\# installation on Linux and macOS](https://pvs-studio.com/en/docs/manual/0051/)
1. [How to run PVS\-Studio Java](https://pvs-studio.com/en/docs/manual/6703/)
1. [Get started with PVS\-Studio in Visual Studio](https://pvs-studio.com/en/docs/manual/6522/)
1. [Using PVS\-Studio with JetBrains Rider and CLion](https://pvs-studio.com/en/docs/manual/0052/)
1. [How to use PVS\-Studio in Qt Creator](https://pvs-studio.com/en/docs/manual/6455/)
1. [PVS\-Studio for embedded development](https://pvs-studio.com/en/docs/manual/0045/)
1. [Analysis of Unreal Engine projects](https://pvs-studio.com/en/docs/manual/0043/)
1. [Analyzing Visual Studio / MSBuild / \.NET Core projects from the command line using PVS\-Studio](https://pvs-studio.com/en/docs/manual/0035/)
1. [Analysis of C\+\+ projects based on JSON Compilation Database](https://pvs-studio.com/en/docs/manual/6557/)
1. [Build\-system independent analysis \(C and C\+\+\)](https://pvs-studio.com/en/docs/manual/0031/)
1. [How to integrate PVS\-Studio into CMake with a CMake module](https://pvs-studio.com/en/docs/manual/6591/)