<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shweta singh</title>
    <description>The latest articles on DEV Community by Shweta singh (@shwetasingh02).</description>
    <link>https://dev.to/shwetasingh02</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4257022%2F0fbfbac5-df87-43ff-8561-c8447bd5e7fa.png</url>
      <title>DEV Community: Shweta singh</title>
      <link>https://dev.to/shwetasingh02</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shwetasingh02"/>
    <language>en</language>
    <item>
      <title>How I Fixed the Missing Run Button and Maven Sync Errors in IntelliJ IDEA</title>
      <dc:creator>Shweta singh</dc:creator>
      <pubDate>Sat, 21 Nov 2026 09:29:12 +0000</pubDate>
      <link>https://dev.to/shwetasingh02/how-i-fixed-the-missing-run-button-and-maven-sync-errors-in-intellij-idea-2g1g</link>
      <guid>https://dev.to/shwetasingh02/how-i-fixed-the-missing-run-button-and-maven-sync-errors-in-intellij-idea-2g1g</guid>
      <description>&lt;p&gt;While creating my first Spring AI project using &lt;strong&gt;Java 17, Spring Boot, and Maven&lt;/strong&gt;, I faced several issues. The Run button was disabled, Maven synchronization was failing, and Spring Boot imports were showing errors.&lt;/p&gt;

&lt;p&gt;After troubleshooting, I managed to fix them. Here's what I learned.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Java SDK Not Configured
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Error:&lt;/strong&gt; &lt;code&gt;Module JDK is not defined&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open File → Project Structure → Project.&lt;/li&gt;
&lt;li&gt;Select Java 17 as the Project SDK.&lt;/li&gt;
&lt;li&gt;Go to Modules → Dependencies.&lt;/li&gt;
&lt;li&gt;Set Module SDK to Project SDK.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What I learned:&lt;/strong&gt; IntelliJ needs a properly configured JDK to compile and run Java applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Green Run Button Missing
&lt;/h2&gt;

&lt;p&gt;Even though my &lt;code&gt;main()&lt;/code&gt; method was correct, the green Run icon was missing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Right-click &lt;code&gt;src/main/java&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Select Mark Directory as → Sources Root, if not already marked.&lt;/li&gt;
&lt;li&gt;Open Run → Edit Configurations.&lt;/li&gt;
&lt;li&gt;Create a Maven Run Configuration with the command &lt;code&gt;spring-boot:run&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What I learned:&lt;/strong&gt; IntelliJ must recognize the source directory. A Maven Run Configuration also allows the application to be started from the IDE.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Maven Sync Failed
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Error:&lt;/strong&gt; &lt;code&gt;com.google.inject.CreationException&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Spring Boot imports, including &lt;code&gt;@SpringBootApplication&lt;/code&gt;, appeared red.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What worked for me:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Settings → Build Tools → Maven.&lt;/li&gt;
&lt;li&gt;Change Maven home path from Use Maven Wrapper to Bundled (Maven 3).&lt;/li&gt;
&lt;li&gt;Reload all Maven projects.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After reloading, the dependency errors disappeared.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I learned:&lt;/strong&gt; Maven downloads and manages project dependencies, while IntelliJ's Maven importer makes them available to the IDE. Changing the Maven version helped in my environment, but it may not fix every Maven synchronization issue.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Spring AI API Key Error
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Error:&lt;/strong&gt; &lt;code&gt;Failed to load ApplicationContext&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Spring AI attempted to initialize an OpenAI model without the required API credentials.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Configure the OpenAI API key using an environment variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;&lt;span class="na"&gt;spring.ai.openai.api-key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;$&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="no"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What I learned:&lt;/strong&gt; Spring Boot uses auto-configuration to create beans during startup. If a required configuration is missing, bean initialization may fail.&lt;/p&gt;

&lt;p&gt;Always keep API keys outside source code.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Port 8080 Already in Use
&lt;/h2&gt;

&lt;p&gt;While running my application, I encountered another error:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Port 8080 was already in use&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Stop the previously running application using &lt;code&gt;Ctrl + C&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Alternatively, configure a different port:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;&lt;span class="na"&gt;server.port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;8081&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What I learned:&lt;/strong&gt; Only one application can normally listen on the same IP address and port combination at a time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Result
&lt;/h2&gt;

&lt;p&gt;After fixing the SDK configuration, Maven synchronization, and project settings, my Spring Boot application built successfully, and the Run button started working.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Always verify your Java SDK configuration.&lt;/li&gt;
&lt;li&gt;Make sure &lt;code&gt;src/main/java&lt;/code&gt; is recognized as a Sources Root.&lt;/li&gt;
&lt;li&gt;Understand the difference between Maven builds and Maven synchronization.&lt;/li&gt;
&lt;li&gt;Check the actual root cause instead of focusing only on &lt;code&gt;BUILD FAILURE&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Keep API keys secure using environment variables.&lt;/li&gt;
&lt;li&gt;Understand the difference between configuration errors, dependency issues, and runtime failures.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This experience taught me that debugging is not just about fixing errors. It is also about understanding how different tools work together.&lt;/p&gt;

&lt;p&gt;As a Java Backend Developer exploring Spring AI, I realized that understanding &lt;strong&gt;Maven, IntelliJ, Spring Boot auto-configuration, and application startup&lt;/strong&gt; is just as important as writing code.&lt;/p&gt;

&lt;p&gt;Every error is an opportunity to learn something new!&lt;/p&gt;

</description>
      <category>debugging</category>
      <category>java</category>
      <category>springboot</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
