7
votes

I am using Windows 7 and IntelliJ 12. I downloaded Tomcat and I can use it just fine. I want to use Jetty as well. But I wasn't able to.

Is Jetty coming with IntelliJ ?

Can someone guide me how to use Jetty? Thanks.

4

4 Answers

6
votes

Yes, IntelliJ brings Jetty support, but only in Ultimate Edition.

If you do have it you'll need to create Jetty Run/Debug Configuration and fill in the required details.

Jetty configuration

5
votes

I have the same confusion before I fix it. Given my solution, hope it helps for somebody.

My environment: Jetty 9.1 and Intellij 13.0.1

1. note two points: the default port is 8080 unless you changed it; jmx mod must be chosen.

intellij13-jetty9-run-debug-config1

2. choose the war file to deploy in Deployment tab and setup your context path.

intellij13-jetty9-run-debug-config2

2
votes

One reason you might see the error is if you forgot to specify an artifact to deploy. Go to the Run/Debug Configurations Deployment tab and add your artifact. (Using IntelliJ IDEA 12.1.4 ultimate)

2
votes

You can also simply use the maven plugin if your project is a maven project..

<plugin>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <version>8.1.9.v20130131</version>
    <configuration>
        <webApp>
            <contextPath>/${project.artifactId}</contextPath>
        </webApp>
        <stopKey>STOP</stopKey>
        <stopPort>9999</stopPort>
        <scanIntervalSeconds>5</scanIntervalSeconds>
    </configuration>
</plugin>

Then simply run jetty-run.