JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.

If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.

If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.

CodeSonar® 9.2p0 CONFIDENTIAL CodeSecure Inc
General
C and C++
Java
Third-Party External

CodeSonar Plug-in for Eclipse: Setting Up

This section explains how to install and configure the CodeSonar plug-in for Eclipse.



Prerequisites

Before installing the CodeSonar plug-in for Eclipse, ensure that all of the following are installed. For detailed instructions, see Prerequisite Details.

Note

In this section (and throughout this manual), $CSONAR indicates the CodeSonar installation directory.

Prerequisite Details

Follow these instructions to ensure all prerequisites for installing the CodeSonar plug-in for Eclipse have been satisfied.

  1. If CodeSonar is not already installed, install it now.
  2. If Eclipse is not already installed, install it now:
    1. Download the "Eclipse Standard" package for your local operating system from eclipse.org Downloads.
    2. Extract the package on your machine.
    3. Follow any additional instructions provided in the package INSTALL and README files.
  3. Start Eclipse.
  4. Check to see if the CDT plug-in for Eclipse is installed.
    1. In Eclipse, select Help > About Eclipse.
      An About Eclipse dialog will open.
    2. Click the Installation Details button in the About Eclipse dialog.
      An Eclipse Installation Details dialog will open.
    3. Check: do "C/C++ Development Tools" and "C/C++ Development Tools SDK" appear in the Installed Software tab of the Eclipse Installation Details dialog, with version number 8.0, 8.1, or 8.2?
  5. Install the CDT plug-in (if it is already installed, or if you do not want to analyze any C or C++ projects, go on to check to see if the JDT plug-in for Eclipse is installed).
    1. Determine the URL for the CDT plug-in that matches your Eclipse version by consulting the CDT Downloads page.
    2. Select Help > Install New Software.
      An Install dialog will open.
    3. In the Install dialog, click the Add button (in the upper left corner).
      An Add Repository dialog will open.
    4. In the Location field of the Add Repository dialog, enter the CDT plug-in URL that you determined in step 5a.
    5. Click OK.
      The Install dialog will now show two options:
      • CDT Main Features.
      • CDT Optional Features.
    6. Select both options.
    7. Click Next and work through the remainder of the installation process.
      When you are prompted with the option to restart Eclipse, click Yes.
  6. Check to see if the JDT plug-in for Eclipse is installed.
    1. In Eclipse, select Help > About Eclipse.
      An About Eclipse dialog will open.
    2. Click the Installation Details button in the About Eclipse dialog.
      An Eclipse Installation Details dialog will open.
    3. Change to the Plug-ins tab.
    4. Check: does "Eclipse Java Development Tools" appear on the list of installed plug-ins?
  7. Install the JDT plug-in (if it is already installed, or if you do not want to analyze any Java projects, go on to check your Java installation).
    1. Determine the download URL that matches your Eclipse version.
      • For Eclipse Kepler, the URL is:
        http://download.eclipse.org/releases/kepler
      • For other Eclipse versions:
        http://download.eclipse.org/releases/<versionname>
    2. Select Help > Install New Software.
      An Install dialog will open.
    3. In the Install dialog, click the Add button (in the upper left corner).
      An Add Respository dialog will open.
    4. In the Location field of the Add Repository dialog, enter the download URL that you determined in step 7a.
    5. Click OK.
      The Install dialog will now show a list of options.
    6. Click the arrow next to Programming Languages to show further options.
    7. Select Eclipse Java Development Tools.
    8. Click Next and work through the remainder of the installation process.
      When you are prompted with the option to restart Eclipse, click Yes.
  8. Check your Java installation. Run the following command line:
    java -version
  9. Install Java (if a suitable version is already installed, go on to Installing the CodeSonar Plug-in).
  10. Go on to Install the CodeSonar Plug-in.

Install the CodeSonar Plug-in

There are two ways to install the CodeSonar plug-in:

These instructions use the codesonar eclipse-install approach.

  1. Make sure that $CSONAR/codesonar/bin is in your PATH.
  2. Run
    codesonar eclipse-install path/to/EclipseDir
    where path/to/EclipseDir is the Eclipse installation directory. If the directory path includes spaces, enclose it in double quotes "".
  3. Check to make sure that path/to/EclipseDir/dropins/com.codesonar.eclipse.jar now exists.
  4. Start Eclipse.
    The top menu bar will now include a CodeSonar menu.
  5. Go on to Configure the CodeSonar Plug-in.

Configure the CodeSonar Plug-in

Make sure the CodeSonar plug-in is configured correctly: it needs the CodeSonar installation path in order to perform the CodeSonar build/analysis.

  1. From the top menu bar, select CodeSonar > Preferences.
    Eclipse will display the Preferences dialog, with the CodeSonar preferences selected.
  2. Check: does the Installation Path field contain the full path to the CodeSonar installation directory?

Uninstalling

To uninstall the CodeSonar plug-in for Eclipse, do the following.

  1. Remove file path/to/EclipseDir/dropins/com.codesonar.eclipse.jar, where path/to/EclipseDir is the Eclipse installation directory.
  2. Restart Eclipse.

When You Upgrade CodeSonar

Once you have upgraded CodeSonar, upgrade your plug-in installation:

  1. Uninstall the old version of the plug-in.
  2. Install the updated plug-in.
  3. Configure the plug-in.

Now that the CodeSonar plug-in is installed and configured, you can:

Eclipse Plug-in Links

The following sections provide detailed information about installing and using the CodeSonar plug-in for Eclipse.

 

To report problems with this documentation, please visit https://support.codesecure.com/.