title: How to run on GlassFish in IntelliJ?
body: <p>I am using <strong>IntelliJ</strong>, and I have a J2EE project. I have setted up a local GlassFish server in the IDE, but how can I configure the project to run on that local GlassFish server?</p>
  
  <p>My project uses Java EE's features (such as servlets), but IntelliJ says that those libraries do not exist:</p>
  
  <p><img src="https://i.stack.imgur.com/HMwOd.png" alt="enter image description here"></p>
  
  <p>I can't run my project either:</p>
  
  <p><img src="https://i.stack.imgur.com/XMYM2.png" alt="enter image description here"></p>
  
  <p><strong><em>How do I associate my local GlassFish server with the project, and enable the GlassFIsh's library?</em></strong></p>