Saturday, August 23, 2008

Step 2 Installation Java Technologies

First, unzip the eclipse-java-ganymede-win32 folder in a directory you will want to store Eclipse. To unzip the folder, select the right mouse button->select unzip or "extract all" ->select the appropriate directory.

Extract the file tomcatPluginV321 to the eclipse/plugin directory.

Extract the apache-tomcat-5.5.26 where you would like to store your Tomcat.

You will need to set some environmental variables. One is called JAVA_HOME and the other one is called CATALINA_HOME.

Select your “my Computer” with your right mouse button and select properties->select the advanced tab->select the environmental variable tab. Under your "user variable", select the new button, and type the variable name to be JAVA_HOME. For the value you should put the path to the location of your Java. (ex. C:\Program Files\jdk1.5.0_02) You should also add the Java bin directory to your class path. Select on the path variable (you should already have one but if not, then press new to create one (the value would be path)) and select the edit button. Paste the path to your Java bin directory. You should seperate each path location by a semicolon. (ex: C:\Program Files\jdk1.5.0_02\bin)

The bin directory is the folder that contains the javac file. The javac is the Java compiler to compile your code.

You need to do the same thing for Tomcat. Add a variable called CATALINA_HOME that points to where your Tomcat is located. (ex: C:\Tomcat)

Extract the mysql-5.1.26-rc-win32 file. You will see a setup icon that you can select to install mysql. When installing mysql, you probably only need to select the Typical install. You should select Detailed Configuration, and select Developer machine. Select the "transactional database" only radio button. You can select Decision Support and then select Install as a window service. Input a new root password for your mysql account. I will use admin as my password.

If you want to install Tomcat as a service too, you can do that by opening a command prompt and traversing to the bin directory. You should type service.bat install to install tomcat as a service. That command will install Tomcat as a service. If you want to remove the service, go to the same directory and type: service.bat remove to uninstall it. You can also type sc NAMEOFSERVICE to uninstall a service. This is not required for this tutorial however. You probably only need to install Tomcat as a service on a production machine.

If you are trying to install Tomcat as a service and you are running into issues. You should read my post on possible tomcat issues installing it as a service.
Tomcat Service Issues



The other files you downloaded will be used later when I show you how to attach your jar files to your project in eclipse.

You will need to make sure that your Eclipse is pointing to your Tomcat installation and to your Java installation. You can verify this by going to windows->preferences and selecting Tomcat and Java in Eclipse. You should make sure they are pointing to your Catalina_Home and Java_Home and that they are using the correct versions for each. For your Java, you should make sure it has the correct installed JREs by selecting Java and installed JREs. If these are pointing to the wrong place or using the wrong versions, you might receive an error later. The Installed JREs should have the location to your JAVA_HOME: C:\Program Files\Java\jdk1.5.0_07. The Name will be jdk1.5.0_07 which is the version you are using.


Your installations are completed

Go To Step 3

Read more...

Step 1 Java, Hibernate, Struts, Tomcat, Eclipse, mySQL, JSP, Servlets, AJAX Tutorial with Testing

When I was learning some J2EE technology, I never quite found a tutorial that covered all the areas that I wanted to learn with easy step by step instructions. So I am going to attempt to do that here. If you find my tutorial helpful, please leave a comment, and if you know of something I should mention to help you, then you can leave a comment about that too.

All the technologies that I will mention are open source so you can download them directly to your computer.

Assumptions:

I am assuming you are using Windows XP or Windows Vista, and I am assuming that you have some programming experience in Java. You will also need to know how to use the web. If you need to learn JAVA first, you can visit the following tutorials.

Some tutorials are:
http://java.sun.com/docs/books/tutorial/
http://www.javabeginner.com/
http://www.java2s.com/Tutorial/Java/CatalogJava.htm/

You will also need to be familiar with HTML and XML.
XML tutorial:
http://www.w3schools.com/xml/default.asp
HTML tutorial:
http://www.w3schools.com/html/html_intro.asp

If you are a beginner Java programmer and you want to get familiar with a beginning Java IDE, you can download BlueJay at:
http://www.bluej.org/download/download.html

Step 1 download needed files :

You will need to make sure you have the technology installed on your computer.
You should put these entire downloads in a separate folder for when we need them.

Download Tomcat 5.5 (select the zip link under the Binary Distributions Core):
http://tomcat.apache.org/download-55.cgi

Download Eclipse (Eclipse IDE for Java Developers (85 MB) select a mirror to download eclipse from:
http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/ganymede/R/eclipse-java-ganymede-win32.zip

Download the Tomcat Eclipse plugin from (tomcatPlughV321.zip version 3.2.1):
http://www.eclipsetotale.com/tomcatPlugin.html

I am going to start with a tutorial for Struts 1 because Struts 2 is quite different. So visit this website and download struts-1.3.8-all.zip.
http://struts.apache.org/download.cgi#struts20112

Download mySQL (windows ZIP/Setup.EXE): http://mysql.llarian.net/downloads/mysql/5.1.html

Download Hibernate from (hibernate-distribution-3.3.0.SP1-dist.zip):
http://sourceforge.net/project/showfiles.php?group_id=40712&package_id=127784&release_id=620785/&abmode=1

The c3p0-0.9.1.2 jar file is included in the Hibernate download or you can download it separately from here:

http://sourceforge.net/project/showfiles.php?group_id=25357
You will need this for hibernate to manage your connection pool.

You also need a version of xerces and xalan for Struts.
You should download Xerces-J-bin.1.4.4.zip from
http://archive.apache.org/dist/xml/xerces-j/

and

xalan-j_2_7_1
http://www.apache.org/dyn/closer.cgi/xml/xalan-j


You can download JAVA 1.5 here if you do not already have it:
http://java.sun.com/javase/downloads/index_jdk5.jsp
I would download Java JDK 5.0 with Java EE

After downloading all of your needed files for this tutorial, go to step two for set up and configuration.

Go To Step 2

Read more...