title: Build and Debug Tomcat Source in Intellij
body: <p>I need to build and debug tomcat in intellij. I have tried a number of guides as noted below without much success.</p>
  <p><strong>System Variables:</strong></p>
  <ul>
  <li>ANT_HOME = C:\Users\User1\Desktop\Tomcat\apache-ant-1.10.9</li>
  <li>CATALINA_HOME = C:\Users\User1\Desktop\Tomcat\apache-tomcat-9.0.41</li>
  <li>JAVA_HOME = C:\Program Files\Java\jdk1.8.0_281</li>
  <li>PATH: ...;%JAVA_HOME%\bin;%ANT_HOME%\bin;%CATALINA_HOME%\bin</li>
  </ul>
  <p><strong>File Paths:</strong></p>
  <ul>
  <li>C:\Users\User1\Desktop\Tomcat\apache-ant-1.10.9</li>
  <li>C:\Users\User1\Desktop\Tomcat\apache-tomcat-9.0.41</li>
  <li>C:\Users\User1\Desktop\Tomcat\apache-tomcat-9.0.41-src</li>
  </ul>
  <p><strong>Intellij Version:</strong> 2020.3.1</p>
  <p>Possible solution (<a href="https://stackoverflow.com/questions/43888998/how-to-debug-tomcat-source-code-in-intellij-idea">LINK</a>) but how would you open up the project and how would you configure the run/debug? I believe this would work but I need a step-by-step guide on how to open this in intellij and how it can be built and debugged.</p>
  <pre><code>cd apache-tomcat-9.0.41-src
  ant -buildfile build.xml ide-intellij
  </code></pre>
  <p>Alternative solutions but appear outdated:</p>
  <ul>
  <li><a href="https://www.programmersought.com/article/66456102742/" rel="nofollow noreferrer">Solution 1</a></li>
  <li><a href="https://intellij-support.jetbrains.com/hc/en-us/community/posts/206891315-Building-Tomcat-from-sources-with-Ant-and-Idea-" rel="nofollow noreferrer">Solution 2</a></li>
  </ul>