Reputation: 4199
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:
I can't run my project either:
How do I associate my local GlassFish server with the project, and enable the GlassFIsh's library?
Upvotes: 6
Views: 26181
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.
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.
Upvotes: 4
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