Water Cooler v2
Water Cooler v2

Reputation: 33870

How to create a Java Servlet application in IntelliJ IDEA Community Edition with Java EE 7 and Glassfish 4?

I want to create a Java Servlet. I know nothing about the Java ecosystem except a tiny bit of the Java language.

I already had JDK 1.8.0_65 on my machine and JRE 6 as well.

I looked up this article. It said I could use Glassfish as the application server. Java 7 EE comes with Glashfish 4.

So, I went to this page and downloaded the Java Platform, Enterprise Edition 7 SDK Update 2 for Windows. I am running 64-bit Windows 7 Home Premium. It is presently a 128 MB download.

To install it, I looked up the very unhelpful instructions on this web page. That didn't help me because this page says almost nothing except: please unzip your download and then ???, and then profit.

But this video helped me. Here's what I did.

I unzipped the folder and placed the uncompressed folder in my %Program Files%\Java folder. Then I ran the %Program Files%\Java\java_ee_sdk-7u1\glassfish4\glassfish\bin\startserv.bat file and browsed to the Url http://localhost:4848 and the Glassfish Console started up just fine.

Then as per the instructions in the Creating a project section on this page, I opened up the IntelliJ IDEA Community Edition 2016.2.1 IDE, which I already had installed previously, and clicked the Create New Project menu item in the start-up dialog.

However, in the New Project dialog, I do not see the option Java Enterprise as the article suggested. This is what my New Project dialog looks like.

enter image description here

What do I do now? I just want to create a simple Web application using servlets.

One difference I note is that the article suggests that I have IntelliJ IDEA Ultimate Edition, which I do not have. Is it not possible to create servlets using the community edition of IntelliJ IDEA?

Upvotes: 7

Views: 14554

Answers (4)

Mohan Teja Chitturi
Mohan Teja Chitturi

Reputation: 169

No you cannot create Enterprise applications in intellij community ,But you can run the servlets using google appengine in intellij community.I recommend you read this post

Upvotes: 0

Nicholas Begg
Nicholas Begg

Reputation: 17

I don't think intellij idea will read what you installed. Try using maven, and select webapp. Then search for the maven respiratory for servlets. I'm note even sure it will work. Your best bet for a free ide would be eclipse. Its not the best for beginners, but it's better than netbeans. Or you could simply waste your money on the paid version.

Upvotes: 0

kyle
kyle

Reputation: 129

Netbeans is your best option to just make it work right now If you download the Java EE version of netbeans everything is ready to go. Also most of the canonical getting started documentation focuses on/ is highly coupled with Netbeans development.

This is a Netbeans focus/opinionated setup guide from oracle. https://docs.oracle.com/javaee/7/tutorial/usingexamples001.htm

Upvotes: 1

Javasick
Javasick

Reputation: 3003

IntelliJ IDEA Comunity Edition can't create Java Enterprise applications, but Ultimate Edition can (IntelliJ IDEA Editions comparison matrix). Use it, or some another free IDE Eclipse, Netbeans etc.

Upvotes: 7

Related Questions