Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat in Intellij Idea Community Edition

Is it possible to run a web application using Tomcat Server in Intellij Idea Community Edition?

I tried to find some information about it but haven't achived any success.

like image 713
Viktoriia Avatar asked Feb 26 '14 16:02

Viktoriia


People also ask

Can you use Tomcat on IntelliJ community?

You'll need to set the Debugger mode to Attach to remote JVM , the Transport to Socket , the Host to localhost and lastly the Port to 8000 . That way when you start the configuration, Intellij will connect via Socket to the Tomcat server that emits via port 8000 .

Can we add application server in IntelliJ Community Edition?

IntelliJ IDEA provides integration with various application servers, enabling you to start and stop local servers, connect to running remote servers, and deploy your artifacts on those servers. You can also debug your application right from the IDE.


2 Answers

Intellij Community does not offer Java application server integration. Your alternatives are

  1. buying Intellij licence,
  2. switching to Eclipse ;)
  3. installing Smart Tomcat plugin https://plugins.jetbrains.com/plugin/9492
  4. installing IDEA Jetty Runner plugin https://plugins.jetbrains.com/plugin/7505
  5. running the application server from Maven, Gradle, whatever, as outlined in the other answers.

I personally installed the Jetty Runner plugin (Jetty is fine for me, I do not need Tomcat) and I am satisfied with this solution. I had to deal with IntelliJ idea - Jetty, report an exception, though.

like image 54
user7610 Avatar answered Sep 23 '22 13:09

user7610


If you are using maven, you can use this command mvn tomcat:run, but first you add in your pom.xml this structure into build tag, just like this:

<build>     <finalName>mvn-webapp-test</finalName>       <plugins>           <plugin>               <groupId>org.apache.maven.plugins</groupId>               <artifactId>maven-compiler-plugin</artifactId>               <version>${maven.compiler.plugin.version}</version>               <configuration>                   <source>1.6</source>                   <target>1.6</target>               </configuration>           </plugin>       </plugins>   </build> 
like image 44
arielduarte Avatar answered Sep 21 '22 13:09

arielduarte