For Intellij 14.0.0 the Application server option is available under
View > Tools window > Application Server (But if it is enable, i mean if you have any plugin installed)
The maven plugin and embedded Tomcat are usable work-arounds (I like second better because you can debug) but actual web server integration is a feature only available in intelij paid editions.
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.
Near the run button, from the dropdown, choose "edit configurations..."
On the left, click the plus, then maven and rename it "Tomcat" on the right side.
for command line, enter "spring-boot:run"
Under the runner tab, for 'VM Options', enter "-XX:MaxPermSize=256m -Xms128m -Xmx512m
-Djava.awt.headless=true" NOTE: 'use project settings' should be unticked.
For environment variables enter "env=dev"
Finally, click Ok.
When you're ready to press run, if you go to "localhost:8080/< page_name > " you'll see your page.
I am using intellij CE to create the WAR, and deploying the war externally using tomcat deployment manager. This works for testing the application however I still couldnt find the way to debug it.
open cmd and current dir to tomcat/bin.
you can start and stop the server using the batch files start.bat and shutdown.bat.
Now build your app using mvn goal in intellij.
Open localhost:8080/ **Your port number may differ.
Use this tomcat application to deploy the application, If you get the authentication error, you would need to set the credentials under conf/tomcat-users.xml.
Run >> Edit Configurations >> + >> Maven
Parameters tab ...
Name :: Tomcat
Working Directory :: Project Root Directory
Command Line :: tomcat7:run
Runner tab ...
VM Options :: <user needed options>
JRE :: <project needed>
Invoke Tomcat in Run/Debug mode directly from IntelliJ Run >> Run/Debug menu
NOTE: Though this is considered a hacking of using using Tomcat integration features of IntelliJ - Enterprise version features, but I would consider this a programmatic way integrating tomcat to the IntelliJ Idea - community edition.
Then follow the error messages if there are any - maybe you would need to install some other stuff (just google it and that mvnrepository.com would come up). To install use this command:
replace path with where you downloaded the jar file, replace version, group and artifact id with info from mvnrepository.com.
Further errors I encountered:
I had to create a class in src/main/java (with simple System.out.println command in main) and add <start-class>main.java.Hello</start-class> in <properties> tag in pom.xml. Btw, the pom.xml should appear itself when you do the first action from my answer - copy paste Jay Lin's code there.
Another error I got was connected to JAVA_HOME variable and the verion stuff. Somewhy it thought jdk is 7th version and I was telling it was 8th. So I changed the java version tag in <properties> to this <java.version>1.7</java.version>.
If you use Gradle, you can try my script: https://github.com/Adrninistrator/IDEA-IC-Tomcat .This script will build files for web application, create a Tomcat instance, start Tomcat and load the web application.
Well the question is already answered, however what I am writing here is just my observation so other fellows in the community can save some of their time.
I tried running a spring-mvc project using the embedded tom-cat in Intellij communit edition.
First try I did was using the Gradle tom-cat plugin, however the problem that I faced there is the tomcat server just starts once, after that from the second start the build complains saying that a container is already running.
There are so many open thread on the web about this, for some it works and for most of the people (almost 90% of the web threads that I broke my head with, faced the same problem of container not getting started the second time. The resolution is not there.
After wasting a lot lot of my time, I finally decided to switch to maven tom-cat plugin and do the same spring-mvc setup with maven that I did with gradle and VOILA! it worked in the first short.
So long story short, if you are setting up spring-mvc project in intellij community edition, please consider maven tomcat plugin.
Hope this helps somebody's hours of exploration across various web forums.
Using Tomcat 9 in IntelliJ IDEA Community Edition without installing any plugin
Note: Make sure environment variables JAVA_HOME and CATALINA_HOME is set. And in case value for JAVA_HOME or CATALINA_HOME is reset recently then restart IntelliJ IDEA before proceeding further.
First open the project in IntelliJ IDEA and then click on File > Settings... > Tools > External Tools, then click on the + button.
Then we have to specify the Name for the Tomcat, then in the Program we
have to specify the path for the catalina.bat file in the bin folder in
the folder where Tomcat is installed, then in Arguments we have to write jpda run and then click on Ok and then on Apply.
After that we can we run the Tomcat by clicking on Tools > External Tools > name_you_provided_for_tomcat.
Then we have to put the necessary files of the application we want to host on the Tomcat in the webapps folder in the folder where Tomcat is installed.