Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 376
Victor2748 Avatar asked Feb 09 '15 04:02

Victor2748


1 Answers

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

like image 129
Amir Keshavarz Avatar answered Oct 03 '22 20:10

Amir Keshavarz