How to Setup Eclipse IDE for Sonar Analysis

This article describes steps required to configure your eclipse for SonarQube such that developers are not required to leave the eclipse IDE to manage their source code quality. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos.
Following are the key points described later in this article:
  • Installing & Configuraing SonarQube in Eclipse
  • Analyzing code using SonarQube


Installing & Configuring SonarQube in Eclipse

Follow the steps given on following pages to install and configure SonarQube in your Eclipse IDE.

  • The page on Installing SonarQube in Eclipse consists of steps required to install SonarQube in the IDE. Once downloaded, it would prompt to restart the Eclipse IDE. For proceeding ahead, you must restart the Eclipse IDE.
  • The page on Configuring SonarQube in Eclipseconsists of steps required to configure Eclipse for SonarQube. The key thing to note is the fact that as you click on Preferences > SonarQube > Servers, you see the default server entry for http://localhost:9000. Initially, as per instruction page, seeing the default entry, I went ahead to next step for linking the project to SonarQube server and run the analysis. However, it throw the error such as Unknowb version of SonarQube server. After a little research, I figured out that the error was thrown as the SonarQube Server was not reachable although I saw it configured as http://localhost:9000. The solution is to go to Preferences > SonarQube > Servers, click “Edit” button and you would see SonarQube Server URL, username and password. The key is to give username and password and run the analysis once again.

 

Analyzing code using SonarQube

Once you are done with installation and configuration of SonarQUbe server in Eclipse IDE, for code analysis, all you need is right click on your project and click SonarQube > Analyze and that is it. The violations would appear in SonarQube analysis as shown in the screenshot below.

sonarqube analysis in eclipse

However, do note that these issues may not appear if you try to access on the browser. For that to happen, you need to once again run “sonar-runner” from the project root.


Ajitesh Kumar

I have been recently working in the area of Data analytics including Data Science and Machine Learning / Deep Learning. I am also passionate about different technologies including programming languages such as Java/JEE, Javascript, Python, R, Julia, etc, and technologies such as Blockchain, mobile computing, cloud-native technologies, application security, cloud computing platforms, big data, etc. I would love to connect with you on Linkedin. Check out my latest book titled as First Principles Thinking: Building winning products using first principles thinking.

Recent Posts

Mathematics Topics for Machine Learning Beginners

In this blog, you would get to know the essential mathematical topics you need to…

20 hours ago

Questions to Ask When Thinking Like a Product Leader

This blog represents a list of questions you can ask when thinking like a product…

4 days ago

Three Approaches to Creating AI Agents: Code Examples

AI agents are autonomous systems combining three core components: a reasoning engine (powered by LLM),…

1 week ago

What is Embodied AI? Explained with Examples

Artificial Intelligence (AI) has evolved significantly, from its early days of symbolic reasoning to the…

2 months ago

Retrieval Augmented Generation (RAG) & LLM: Examples

Last updated: 25th Jan, 2025 Have you ever wondered how to seamlessly integrate the vast…

5 months ago

How to Setup MEAN App with LangChain.js

Hey there! As I venture into building agentic MEAN apps with LangChain.js, I wanted to…

5 months ago