tags:

views:

252

answers:

6

I am a fairly experienced Java programmer that is interested in learning Java EE. Could someone point me to (or describe) how I can get a test environment set up locally so that I can start developing an application (i.e. what webserver I should use, framework if any - Spring? etc.). I am working on a linux machine. I think I will learn much faster this way instead of reading a book or a tutorial. Thanks in advance.

Update: Thanks for the answers so far. Should I start with Spring/Hibernate or should I familiarize myself with the basics of EE first?

+1  A: 

I only have a bit of experience with Java EE, but the setup I have, i like.

I have Eclipse and the Eclipse WebToolsPlatform (WTP) HERE. And I have tomcat installed, and the WTP hooks into Tomcat pretty well. You have test a jsp or servlet inside the IDE (It pops up a new tab that works as a web-browser).

Good Luck

goatlinks
If you get "Eclipse for Java EE" you don't need to get and install WTP separately.
BalusC
Tomcat is just af web container, which is only a fraction of JEE
Thorbjørn Ravn Andersen
+1  A: 
  1. Get and install Java SE JDK.
  2. Get and install "Eclipse IDE for Java EE developers"
  3. Get and install Apache Tomcat 6.0 core binary distribution
  4. Start Eclipse and go to Workbench. Open the Servers view in the right bottom box. Rightclick > New > Server, select Apache Tomcat 6.0 from list, locate the Tomcat installation directory (its root folder) and Finish.
  5. Go to the left column (project explorer). Rightclick > New > Dynamic Web Project, give it a name, ensure that Tomcat is selected as target runtime. On Next you can specify the context name which would then appear as contextname in http://example.com/contextname.

Now you can create classes in project's src folder and create web files in WebContent folder. You can follow any decent JSP/Servlet tutorial for this. For example the Sun Java EE tutorial part II or the Coreservlets tutorials. If you prefer books, I can recommend the Head First Servlets & JSP.

To run a web project, rightclick the Tomcat instance in Servers view, add the newly created web project, start Tomcat server and visit http://localhost:8080/contextname/whateverpage.jsp in your favourite webbrowser.

BalusC
A: 

I would probably suggest learning both Spring and J2EE at the same time. While it does add to what you have to learn it would be a very unusual corporate app that didn't use Spring.

There is a Sun J2EE tutorial you could work your way through which would help with learning bare J2EE.

Sarge
+4  A: 

If you are interested by Java EE, I would warmly suggest to start directly with Java EE 6 which has been officially released last week. Just go to http://java.sun.com/javaee/ and download GlassFish v3. For the integration with the Eclipse Java EE IDE, simply install the GlassFish Server Adapter. You'll find plenty of samples for Java EE 6 at http://java.sun.com/javaee/reference/code/ that you can also get through the GlassFish Update Center (just do it). They will definitely help you to get started.

In your case, my advice would be to start with Java EE 6 "only" for now. Get familiar with EJB 3.1, Servlet 3.0, JPA 2.0 (the Java Persistence API, Hibernate being one implementation), JAX-WS, JAX-RS, maybe JSF (this may still be controversial but I think that the new Servlet 3.0 API makes any advice about web frameworks irrelevant so... I won't make any recommendation here). Leave Spring alone, you won't need it in early steps (you may not need it at all) and there is enough to learn in Java EE 6 itself. If you want to learn Spring, for example because it is widely used in Java EE, at least prior to Java EE 6, you'll still be able to learn it later. But don't worry, Java EE 6 is very impressive and you can do really nice things with it, without the need for Spring.

Pascal Thivent
A: 

If by Java EE you mean EJB 3, then the choice is either that or Spring. I wouldn't recommend both together.

I'd say go for Spring if you want to get by with a servlet/JSP engine like Tomcat for your app server. That's the way that I've gone, and I've found it to be a good direction to take.

If you want Java EE and EJBs, I'd say Glassfish would be a good choice, since it's most likely to be up to date, or JBOSS open source offering (not the Red Hat, for fee stuff).

I think IntelliJ is the best IDE on the market. I'd recommend that over Eclipse.

duffymo
+1  A: 

I suggest you download the latest version of netbeans, it comes with app-server (glassfish), database (derby) and lots of working example projects.

This will give you a quick start into EE without all these boring configuration stuff .

http://netbeans.org/downloads/

After that you may want to integrate hibernate into one of these example projects.

regards

stacker