(last edited on April 29, 2014 at 1:29 am)
There’s a whole world of “enterprise class web development” that I’ve succesfully avoided for the past several years. As a result, my mind is a verdant pasture filled with happy thought and harmless conjecture. But today, I leased some of this virtual property to Java, which apparently has become quite the awesome development environment for web applications; the last time I really did anything with Java development was in 1996. So J2EE, J2SE, JDK, JRE, JavaBeans, Servlets, and Eclipse have rumbled into my headspace, bought up some primo locations, and have set up shop in a new development.
The project: develop a useful reference site that we think might be fun, have commercial potential, and learn some new skills in the bargain. Like I don’t have enough to do…but it’s interesting stuff, and I believe I can lend a hand. Working with new people who care about their work is always worthwhile in my book.
Barry showed me how to set up the environment, which I’m writing down here so I don’t forget:
Download and install J2SE SDK 1.5. This is the Java 2 Standard Edition Software Development Kit, which provides the base Java language, libraries, and support tools. It’s basically everything you need to start programming in Java. The J2SE SDK also installs the Java Runtime Engine (JRE), which is the part that actually
Download and install the Eclipse Platform SDK, which is a program that makes Java not suck to work with. In other words, you get a nice interactive development environment (IDE) so there’s none of that mucking about with the command line. The Java SDK you just downloaded is all command-line based.
Download and install Tomcat, which is the combination Java Environment / Web Server that’s used for hosting Java Server Pages. Tomcat is the “Servlet Container” which runs all the Java components you’ve created and hooks them up to the web server…I think. On Windows, you install it as a service, and access it by visiting localhost:8080 on your web browser.
Download and install MyEclipse, which is an extension to the Eclipse IDE that rolls up all the things you need to do J2EE development in a tidy, convenient package. It costs $30/yr for a subscription, with a 1-month free trial. Sure, you could do this all for free, but 30 bucks for what they’ve done? Apparently, it’s a bargain.
Configure MyEclipse. Double-clicking the MyEclipse icon brings up the Eclipse IDE window. You have to tell MyEclipse which JRE and web server to use for deployment.
Windows->Preferences->Java->Installed JREs: Pick “JDK 1.5”. You may have to browse to the location where the JDK is installed, probably in C:Program FilesJava if you’ve used the defaults.
Windows->Preferences->MyEclipse->Application Servers->Tomcat 5: pick the Tomcat Home Directory, which will set the others.
Windows->Preferences->MyEclipse->Application Servers->Tomcat 5->JDK: Select “jdk1.5.0_01” from the dropdown list. If you don’t see it, you haven’t added it as described two steps above.
Create a new Web Application by going to FILE->New->JSP. Give it a name. It will appear in the “Package Explorer” pane on the left side of the IDE. This will create a template with several files in it.
Make sure the Tomcat server is running. Go to the top toolbar, look for the “Run Server” command (it looks like a little running guy), and choose Tomcat Server Start. Make sure it’s not ALREADY running by checking the task icon bar at the lower right of the Windows screen.
Click the “J2EE Deploy Project to Server” button (to the left of the server button you just pressed), choose your project to deploy. This will copy everything over into the Tomcat directory (you’re running it locally, remember).
Test by going to localhost:8080/projectname, and see what you have wrought!
0 Comments