By Thomas Krehbiel
Out of curiosity and recent disgruntlement with ASP.NET I decided to look into Java web development. I haven’t done this since around 2002, so of course I’ve forgotten everything I ever knew about it. Herein I will attempt to document the knowledge I uncover.
Immediately after arriving at java.sun.com, I remembered that the Java world has a bewildering array of cryptically-named technologies to sort through. There are approximately 100,000 different choices and variations of what you can download and there is almost nothing to guide you toward what you’re supposed to get.
First of all, for web development, get the Java EE SDK, not the Java SE SDK. (SE doesn’t have the servlets and stuff in it.) The Java EE download page has a bunch of different options – the one I got was called “GlassFish Java EE + JDK.” (GlassFish is apparently Sun’s alternative to Tomcat.)
Do not be alarmed at the incredibly ugly, 1990s-looking Swing window that the Java EE SDK installer brings up. Ah, Java Swing. It was one of the main reasons I switched to .NET. Showing a Swing-based installer that looks nothing like a normal Windows app is an especially horrible way to introduce Windows people to Java development. (I guess I should be thankful it even has an installer.)
Beware that Windows 7 64-bit is an “unsupported installation platform” for Java EE 5 SDK Update 7. You have to resize the installer window for the Next button to appear so you can continue anyway.
(I couldn’t help but notice that the SE install goes to C:\Program Files\Java but the EE install goes to some crazy thing like C:\Sun\SDK. Not very Windows-friendly.)
The installation sets up a GlassFish application server so you should be able to browse to http://localhost:8080 when it’s done. I suppose theoretically you could start writing code at this point with a text editor and compile with command-line tools, but I’m definitely not that ambitious.
So I downloaded the Eclipse IDE for Java EE Developers. This was a far, far less painful experience than getting the SDK. This is the greatest thing about Eclipse: You just unzip it somewhere, double-click the executable and it just works. Wouldn’t life be grand if everything worked like that?
Because the SDK installed a GlassFish server and I didn’t particularly feel like trying to setup a Tomcat server, I got a GlassFish plugin for Eclipse. Follow the handy instructions on that page and when it asks for the directory of the GlassFish application server, put in the same place you installed the SDK (eg. C:\Sun\SDK). (It took me a while to figure out that was where the GlassFish application server directory was.)So now theoretically I should be able to create a Java web app. I’ll save that for another time, though, because I have to dig through my backups to find my old Java code.
Comments are the property of their respective owners.
Add a Comment