本文介绍了如何使用Java EE 7和Glassfish 4在IntelliJ IDEA Community Edition中创建Java Servlet应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个Java Servlet。除了一点Java语言之外,我对Java生态系统一无所知。



我的机器上已经安装了JDK 1.8.0_65,而且JRE 6也已安装JDK 1.8.0_65。 >

我抬头看了



我现在该做什么?我只想使用servlet创建一个简单的Web应用程序。



我注意到的一点是表明我有IntelliJ IDEA Ultimate Edition,这是我没有的。使用IntelliJ IDEA的社区版本创建servlet是不可能的?

解决方案

IntelliJ IDEA Comunity Edition不能创建Java Enterprise应用程序,但Ultimate Edition可以()。使用它或其他免费的IDE ,等。

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.

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?

解决方案

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.

这篇关于如何使用Java EE 7和Glassfish 4在IntelliJ IDEA Community Edition中创建Java Servlet应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 00:00