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.
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
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:
/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:
you can also copy the directory of your jre to /usr/local/
/home/morteza/SDK/jdk> sudo cp -r jre/ /usr/local/
and add the environment variable JRE_HOME as before: