Start here

Home
About Klocwork
What's new
Fixed issues
Release notes
Installation

Reference

C/C++ checkers
Java checkers
C# checkers
MISRA C 2004 checkers
MISRA C++ 2008 checkers
MISRA C 2012 checkers
MISRA C 2012 checkers with Amendment 1
Commands
Metrics
Troubleshooting
Reference

Product components

C/C++ Integration build analysis
Java Integration build analysis
Desktop analysis
Refactoring
Klocwork Static Code Analysis
Klocwork Code Review
Structure101
Tuning
Custom checkers

Coding environments

Visual Studio
Eclipse for C/C++
Eclipse for Java
IntelliJ IDEA
Other

Administration

Project configuration
Build configuration
Administration
Analysis performance
Server performance
Security/permissions
Licensing
Klocwork Static Code Analysis Web API
Klocwork Code Review Web API

Community

View help online
Visit RogueWave.com
Klocwork Support
Rogue Wave Videos

Legal

Legal information

Kwant

The kwant command creates a Java build specification based on the information in your ant build file. The kwant command intercepts the invocation of the javac task, and generates a build specification, which can then be used to analyze a Java project.

Prerequisites

Before you can create a build specification, you need to:

  • install the Server package. See Installing Klocwork.
  • install Ant. See Supported Java build tools to see what versions are supported.
  • JAVA_HOME, JDK_HOME and PATH environment variables must be configured with the same values as your Ant build. Below is an example for PATH:
    • Unix:
    PATH=<path_to_ant>/bin:<path_to_JDK>/bin:<klocwork_install>/bin:$PATH
    
    • Windows:
    PATH=<path_to_ant>\bin;<path_to_JDK>\bin;<klocwork_install>\bin;%PATH%
    

For how-to information, see Creating a Java build specification.

Usage

kwant <ant_options>

where <ant_options> are any arguments required for your ant build

Options

Name (and short name) Description
--help (-h) display help
--version display kwant version
--output <file> (-o) write the build specification to <file>. By default, the build specification is written to kwinject.out in the current working directory.
--update (-u) when specified, the existing build specification is updated with the results of the new incremental build instead of overwriting it.