# Installation

For the most part, SonarQube for IDE can be installed directly from your IDE’s Marketplace. Offline installations are also possible and previous versions are available if needed.

## Instructions <a href="#instructions" id="instructions"></a>

SonarQube for Eclipse is a plugin that can be installed in most Eclipse-based IDEs (including Spring Tool Suite, PyDev, and others). You can find the SonarQube for IDE extension directly on the [Eclipse Marketplace](https://marketplace.eclipse.org/content/sonarlint).

### Using the Eclipse Marketplace client <a href="#using-the-eclipse-marketplace-client" id="using-the-eclipse-marketplace-client"></a>

1\. In your Eclipse-based IDE, open the Marketplace client: **Help** > **Eclipse Marketplace**

<div align="left"><figure><img src="https://231328848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkadXEH8HkykK7lKaDvVq%2Fuploads%2Fgit-blob-73b490d294297b1578bcea04a1df3c64102c8a47%2F887fe242bad956d5304411ac36244200abe049cf.png?alt=media" alt="Go to Help > Eclipse Marketplace... to install SonarQube for Eclipse directly from the IDE." width="188"><figcaption></figcaption></figure></div>

2\. Search for `sonarqube`, and select **Install**\*.\*

<div align="left"><figure><img src="https://231328848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkadXEH8HkykK7lKaDvVq%2Fuploads%2Fgit-blob-69bd8223a42ab2a3eebc61176ff3ed921656a21d%2Fa1a0f054520e7fcc942b3459cbaad7706777d8e6.png?alt=media" alt="Install SonarQube for Eclipse in the Eclipse Marketplace by searching for SonarQube." width="563"><figcaption></figcaption></figure></div>

3\. Restart your IDE.

### Using the Eclipse Install New Software wizard <a href="#using-the-eclipseinstall-new-softwarewizard" id="using-the-eclipseinstall-new-softwarewizard"></a>

If you can’t use the Eclipse Marketplace client, you can still directly access the SonarQube for Eclipse update site. See the [official Eclipse documentation](https://help.eclipse.org/?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-124.htm) for full details, and follow these instructions:

1\. Go to **Eclipse** > **Help** and select **Install New Software**.

<div align="left"><figure><img src="https://231328848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkadXEH8HkykK7lKaDvVq%2Fuploads%2Fgit-blob-3fc1908eebb169f70f4ca7d38b01dbfbe40c5f91%2Ff4c11c6d9ffa80f7568d0c46d1c74593f2eb250f.png?alt=media" alt="Go to Help > Install New Software... in the Eclipse file menu to start your SonarQube for Eclipse installation." width="188"><figcaption></figcaption></figure></div>

2\. Select the **Add…** button to add a new repository pointing to `https://eclipse-uc.sonarlint.org`. Give the repository a meaningful name. Don’t worry if you, can’t open this URL in your web browser, Eclipse will automatically look for files [compositeContent.xml](https://eclipse-uc.sonarlint.org/compositeContent.xml) and [compositeArtifacts.xml](https://eclipse-uc.sonarlint.org/compositeArtifacts.xml).

<div align="left"><figure><img src="https://231328848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkadXEH8HkykK7lKaDvVq%2Fuploads%2Fgit-blob-906ed259ed34fed85d54b8314719cff690b89a19%2Fbe1ec882591798bf5c8a700c982444add867ed36.png?alt=media" alt="Add the SonarLint repository URL to the Location field in the Installation Wizard; this points to the SonarQube for Eclipse repository." width="375"><figcaption></figcaption></figure></div>

3\. Select both the newly added *SonarQube for Eclipse repository* and the **SonarLint for Eclipse** feature.

<div align="left"><figure><img src="https://231328848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkadXEH8HkykK7lKaDvVq%2Fuploads%2Fgit-blob-0e35bf3961b53ecc84f444cbade52cfa29996d2d%2F5db89fdf2029e90b87586b948eb29b78f177048d.png?alt=media" alt="Select the SonarQube for Eclipse dependencies and packages to fit your application." width="563"><figcaption></figcaption></figure></div>

4\. Review the features about to be installed, and select **Finish**.

5\. When requested, restart your IDE.

{% hint style="info" %}
By using this method, you will be automatically notified of new updates of SonarQube for Eclipse (assuming you have allowed Eclipse to check for updates).
{% endhint %}

## First taste of SonarQube <a href="#first-taste-of-sonarlint" id="first-taste-of-sonarlint"></a>

Now that you have SonarQube for Eclipse installed, open or create a new project containing source files in a programming language that SonarQube for Eclipse can analyze out of the box: Java, PHP, Python, JavaScripts or HTML. See the [rules](https://docs.sonarsource.com/sonarqube-for-eclipse/using/rules "mention") page for a full list of available languages.

For example in Java, you can copy-paste this code snippet, with a typical bug when copy-pasting `for` loops:

```java
package org.mycompany;

import java.util.logging.Level;
import java.util.logging.Logger;

public class Main {

  private static final Logger LOGGER = Logger.getLogger(Main.class.getName());

  public static void main(String[] args) {
    for (int left = 0; left < 10; left++) {
      for (int right = 0; right < 10; left++) {
        LOGGER.log(Level.INFO, "Pair: ({0},{1})", new Object[] {left, right});
      }
    }
  }

}
```

If you open this Java file within the Eclipse Java editor, you should see SonarQube for Eclipse reporting the issue:

<div align="left"><figure><img src="https://231328848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkadXEH8HkykK7lKaDvVq%2Fuploads%2Fgit-blob-0a2cdbc3782bf3e6cb3f006ec208fc2519d78185%2F617f41689a2ba55ee5311d0656c0fb2d8b9214df.png?alt=media" alt="SonarQube for Eclipse gives you squiggly lines and an Overview ruler mark in the sidebar to help call out issues in the Eclipse code explorer." width="563"><figcaption></figcaption></figure></div>

To get more details about the issue, you can simply hover on the issue location, and a popup will display the issue message:

<div align="left"><figure><img src="https://231328848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkadXEH8HkykK7lKaDvVq%2Fuploads%2Fgit-blob-a5d354622dccb65bdf99cf3e32ac67ba90b125a2%2F68b8e8bdfdf3e4d0389095f43d469c1f5e55bb67.png?alt=media" alt="Hover over an issue found by SonarQube for Eclipse to pull up a message and quick fix (when available)." width="375"><figcaption></figcaption></figure></div>

You can also use the SonarQube for Eclipse **On-The-Fly** view to display the list of issues found by SonarQube for Eclipse. Simply open the view from the menu **Windows** > **Show View** > **Other**.

<div align="left"><figure><img src="https://231328848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkadXEH8HkykK7lKaDvVq%2Fuploads%2Fgit-blob-5f5a15594edd6180e504fca18e5abdcae71c3609%2F2a4926599b182354e942fc85a040f7043c3a5093.png?alt=media" alt="To open a Sonarube view that isn&#x27;t showing, go to Windows > Show View > Other > SonarQube and choose your views. Here, we are opening the On-The-Fly view to see issues found in the open file." width="153"><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="https://231328848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkadXEH8HkykK7lKaDvVq%2Fuploads%2Fgit-blob-de5f713c26c767d1513e8ee80b06640fa0d6569a%2Fb23df9e114b800fa2596a72afa4653e8729e0488.png?alt=media" alt="The SonarQube On-The-Fly view shows you issues found in the active file." width="563"><figcaption></figcaption></figure></div>

## Preferences menu <a href="#preferences-menu" id="preferences-menu"></a>

Once your installation is complete, have a quick look at the SonarQube preferences menu. Navigate to **Window** > **Preferences** > **SonarQube** (or **Eclipse** > **Settings…** > **SonarQube** for Mac OS) for access to the **SonarQube Preferences** menu. Here you will find five menus to:

* Pass additional **Analyzer Properties** to the SonarQube for Eclipse analyzers. More information is available on the [scan-my-project](https://docs.sonarsource.com/sonarqube-for-eclipse/using/scan-my-project "mention") page.
* Add/remove **File Exclusions for** your analysis. See the [file-exclusions](https://docs.sonarsource.com/sonarqube-for-eclipse/using/file-exclusions "mention") for details.
* Agree/disagree to share anonymous telemetry statistics in the **Miscellaneous** menu.
* Access a list of **Release Notes**.
* And specifically define your **Rules Configuration** (when running in stand-alone mode). See [#using-sonar-rules](https://docs.sonarsource.com/sonarqube-for-eclipse/using/rules#using-sonar-rules "mention") for more information about how then work in SonarQube for Eclipse.

## Connect to your server <a href="#updating-sonarlint-in-vs-code" id="updating-sonarlint-in-vs-code"></a>

Connect SonarQube for VS Code to your instance of [SonarQube Server](https://app.gitbook.com/s/LWhbesChsC4Yd1BbhHhS/user-guide/connected-mode), [SonarQube Cloud](https://app.gitbook.com/s/B4UT2GNiZKjtxFtcFAL7/analyzing-source-code/connected-mode), or [SonarQube Community Build](https://app.gitbook.com/s/bqrfLGeD0Y9vE5l9Le42/user-guide/connected-mode) to expand your analysis capabilities and share quality profiles with your team. See the article about connected mode [#benefits](https://docs.sonarsource.com/sonarqube-for-eclipse/connect-your-ide/connected-mode#benefits "mention"), and the [setup](https://docs.sonarsource.com/sonarqube-for-eclipse/connect-your-ide/setup "mention") page for full instructions to get going.
