Victor2748
Victor2748

Reputation: 4199

How to run on GlassFish in IntelliJ?

I am using IntelliJ, 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?

My project uses Java EE's features (such as servlets), but IntelliJ says that those libraries do not exist:

enter image description here

I can't run my project either:

enter image description here

How do I associate my local GlassFish server with the project, and enable the GlassFIsh's library?

Upvotes: 6

Views: 26181

Answers (2)

Amir Keshavarz
Amir Keshavarz

Reputation: 2644

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?

I assume that you did this using Run > Edit Configurations... in which a local or remote Glassfish server can be configured. So in the window of Glassfish edit configurations there is a tab named deployment in which you can add source(s) to be deployed at the server startup.

deploy at the server startup

My project uses Java EE's features (such as servlets), but IntelliJ says that those libraries do not exist:

Go to File > Project structure or press Ctrl+Alt+Shift+S click to open Modules > Dependencies tab press the Add (+) button select Library... and there you can find Glassfish and add it as a dependency.

dependencies

Upvotes: 4

eric-haibin-lin
eric-haibin-lin

Reputation: 377

Did you follow the recommended way to create your J2EE project in Intellij?

Follow the guide here: Getting Started with Java EE 7 and GlassFish 4.0

Upvotes: 1

Related Questions