Java EE



Core J2EE Patterns



Here we are going to learn J2EE together step by step. By J2EE I mean we already know the basic Java and merely JDBC. We know the basic HTML tags. Ok, The most important part of J2EE is its web facilities; and the simplest of J2EE web starts with servlets. A servlet is a Java class file.

First of all install a web application server, namely Apache Tomcat. I did all the stuff in ubuntu starting from scratch by installing a fresh ubuntu.


Install J2EE JDK


download Java JDK from Sun website. Sun gave me java_ee_sdk-5_07-jdk-6u16-linux.bin for Java JDK in a 32-bit Linux operating system. Using the terminal, go to the directory of the file, and execute the following commands.

   
>chmode +x java_ee_sdk-5_07-jdk-6u16-linux.bin
    >sudo ./java_ee_sdk-5_07-jdk-6u16-linux.bin

If the above lines didn't work, simply close the terminal, open a new terminal and execute  >sudo ./java_ee_sdk-5_07-jdk-6u16-linux.bin

To add the JAVA_HOME environment variable to your ubuntu, open the /etc/environment using the root privilages:

>cd /etc/
/etc>sudo gedit environment

add the directory path of your JDK as a new line to the file in the following format; and edit PATH variable as follows:

PATH="/home/morteza/SDK/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
JAVA_HOME="/home/morteza/SDK/jdk"

you can also copy the directory of your jre to /usr/local/

>cd /home/morteza/SDK/jdk/
/home/morteza/SDK/jdk> sudo cp -r jre/ /usr/local/

and add the environment variable JRE_HOME as before:

JRE_HOME="/usr/local/jre"

First Cup of Web

Here, we take our first web page experience. We start by servlets.