How to enter the PVS-Studio license and what is the next move
- What is included in the license
- Ways to activate the license using the graphic interface
- Ways to activate the license from a command line
- Quick start or what's next?
PVS-Studio is a static analyzer for C, C++, C#, and Java code. You can run the analyzer on Windows, Linux and macOS. It is necessary to activate the license before using the analyzer. Please find the section that applies to you and then follow the instructions there.
Note. All actions are performed once the analyzer has been installed. The analyzer is available for download on the "Download PVS-Studio" page.
What is included in the license
The license consists of a user name and a 16-character license key of the "XXXX-XXXX-XXXX-XXXX" format. If you don't have a license, you can fill out the trial request form.
Here is an example of how the license information may look like:
JohnSmith <--- Username
ASD1-DAS3-5KK3-LODR <--- License key
Ways to activate the license using the graphic interface
Microsoft Visual Studio
In the Visual Studio menu, open Extensions > PVS-Studio > Options (PVS-Studio > Options before Visual Studio 2015):

Then navigate to the right side of the menu, to the PVS-Studio > Registration page:

In the 'Name' field, enter the user name. Enter the license key in the 'LicenseKey' field. If you entered valid data, you will see the following message with the license data:

If you entered invalid license data, you will be notified of this:

JetBrains IntelliJ IDEA / Rider / CLion
To enter the analyzer license, you need to open any project in the IDE, then open the plugin settings window by selecting Tools > PVS-Studio > Settings:

In the window that opens, go to the Registration page:

In the 'Name' field, enter the user name. Enter the license key in the 'License Key' field:

If you enter a valid license, the 'Invalid License' label is replaced with 'Valid License' and the license expiration date appears in the 'Expires' field. Click Apply or OK to confirm and save the license.

C and C++ Compiler Monitoring UI
To enter the license, go to the utility menu by selecting Tools > Options > Registration:

You need to enter the user name in the 'Name' field. Enter the license key in the 'LicenseKey' field.
Ways to activate the license from a command line
Windows
If you cannot enter a license in the GUI, you can use the analyzer in a special mode on Windows.
The command line may look like this:
PVS-Studio_Cmd.exe credentials --userName %USER_NAME% ^
--licenseKey %LICENSE_KEY%
The 'USER_NAME' variable is to be replaced by the user name, and the 'LICENSE_KEY' variable is to be replaced by the license key.
When you run PVS-Studio this way, the analyzer writes the license to the settings file in the default location: "%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 the license cannot be entered in the GUI when running the analyzer on Linux/macOS platforms, you can use the special 'pvs-studio-analyzer' utility.
The command line on Linux/macOS may look like this:
pvs-studio-analyzer credentials ${USER_NAME} ${LICENSE_KEY}
The 'USER_NAME' variable is to be replaced by the user name, and the 'LICENSE_KEY' variable is to be replaced by the license key.
When you run PVS-Studio this way, the analyzer writes the license to the settings file in the default location: "~/.config/PVS-Studio/PVS-Studio.lic". If the settings file does not exist, it will be created.
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 (Maven(TODO: ADD LINK TO NEW DOCUMENTATION SECTION ABOUT THE PLUGIN FOR Maven), Gradle(TODO: ADD LINK TO NEW DOCUMENTATION SECTION ABOUT THE PLUGIN FOR Gradle)) and the Java analyzer core(TODO: ADD A LINK TO A NEW DOCUMENTATION SECTION ABOUT THE JAVA ANALYZER CORE).
If you use Maven, the command line for entering the license may look like this:
mvn pvsstudio:pvsCredentials "-Dpvsstudio.userName=${USER_NAME}" \
"-Dpvsstudio.licenseKey=${LICENSE_KEY}"
If you use Gradle, the license can be activated with the following command:
./gradlew pvsCredentials "-Ppvsstudio.userName=${USER_NAME}" \
"-Ppvsstudio.licenseKey=${LICENSE_KEY}"
When using the Java core of the analyzer from the console, it is possible to activate the license with the command:
java -jar pvs-studio.jar --activate-license --user-name $USER_NAME \
--license-key $LICENSE_KEY
The 'USER_NAME' variable is to be replaced by the user name, and the 'LICENSE_KEY' variable is to be replaced by the license key.
Quick start or what's next?
You can read more about running the analyzer on the following pages:
- Getting acquainted with the PVS-Studio static code analyzer on Windows
- How to run PVS-Studio on Linux and macOS (C, C++)
- PVS-Studio C# installation on Linux and macOS
- How to run PVS-Studio Java
- Get started with PVS-Studio in Visual Studio
- Using PVS-Studio with JetBrains Rider and CLion
- How to use PVS-Studio in Qt Creator
- PVS-Studio for embedded development
- Analysis of Unreal Engine projects
- Analyzing Visual Studio / MSBuild / .NET Core projects from the command line using PVS-Studio
- Analysis of C++ projects based on JSON Compilation Database
- Build-system independent analysis (C and C++)
- How to integrate PVS-Studio into CMake with a CMake module