This document describes the lab setup for the ShareWare CourseWare(tm) EJB Programming workshop. There are detailed instructions for Windows and for Linux in this document.
To do the labs, you will need an EJB container. The recommended container is JBoss, which is easy to install and administer. However, you should be able to use any other container (e.g. Allaire JRun or Oracle J2EE Containers) with minor modifications to the lab documentation (no support provided).
Note: If you only want to do the RMI lab, you don't need to install JBoss. The only requirement for the RMI lab is the Java2 Standard Edition SDK Version 1.3 or higher.
Important: Print this document and mark it up with information as requested. You will need this setup information to do the labs.
Install the operating system. Be sure to install TCP/IP networking and give the computer a TCP/IP hostname. Install Internet Explorer or other browser.
If you have not already done so, download the latest non-beta Java2 Standard Edition Software Development Kit (JSDK) and documentation package from http://java.sun.com/j2se. Install both the JSDK and the documentation package. Note the directory where the JSDK was installed, e.g. c:\jdk1.3. Be sure to read the Installation Instructions on the Sun web page.
Note: Be sure to download the SDK, not the JRE.
Update the PATH environment variable permanently so that it includes the JSDK's "bin" directory. Here are instructions for various versions of Windows:
Windows 95, 98, ME: From the Windows Start menu, select "Run" and then type "sysedit" (don't type the quotes). Select the window pane with "autoexec.bat" and find the "PATH" statement. At the start of the current PATH, insert the path of the "bin" directory for your JSDK installation, for example:
c:\jsdk1.4.0\bin;
Be sure to substitute the correct path for where you installed the JSDK. Then choose File-Save and reboot.
Windows NT, 2000, XP: From the Windows Start menu, choose "Settings - Control Panel". In the Control Panel, double-click the "System" icon. Then, depending on which OS you are using, click the "Environment" tab or the "Advanced" tab followed by the "Environment" button. At the start of the current PATH, insert the path of the "bin" directory for your JSDK installation, for example:
c:\jsdk1.4.0\bin;
Be sure to substitute the correct path for where you installed the JSDK. Then press OK as necessary and close any open command prompt windows.
To test the JSDK installation, choose Start - Programs - Command Prompt (on Win2K, choose Start - Programs - Accessories - Command Prompt) and then enter:
java -fullversion
You should see the version number of the JSDK that you installed. If that worked, then test the Java compiler:
javac
You should a listing of Java compiler options. If not, refer to the Installation Notes on the Sun website or re-do the previous step. The most common problem is an incorrect PATH environment variable -- PATH should reference the "bin" directory of the JSDK.
Optionally install the JEditor text editor. The latest version is available from http://jedit.sourceforge.net.
Download the latest "final" version.
To install JEdit, follow the instructions given on the JEdit web page. You should then be able to run JEdit from the Windows Start menu.
Download the JBoss open-source, free EJB container from http://jboss.org/downloads.jsp
Warning: Be sure to download JBoss version 2.4.x instead of version 3.x. The labs currently do not support version 3.x. The zip file's name will be something like:
JBoss-2.4.6.zip
Use WinZip or other unzip program to unzip the JBoss ZIP file onto your hard disk (we recommend unzipping to the root directory on the same disk where you will install the rest of the required software). Write down the directory where you installed JBoss as the JBoss Installation Directory.
_____________________________________________________
Now test JBoss to make sure it works correctly. In your command prompt, change to the JBoss Installation Directory\bin directory and type:
run
You should see a series of diagnostic messages. The last message should be something like:
[INFO,STDERR] JBoss-2.4.6 Started in 0m:11s.887
If not, look for troubleshooting hints on the JBoss website.
Determine the Lab Installation Directory. When you downloaded and installed the EJB Programming Workshop, you expanded the archive to a directory, e.g. c:\ejbclass. Write the Lab Installation Directory here:
_____________________________________________________
Install Jakarta Ant, which will make it easier for you to compile and deploy your EJBs.
Download Ant from:
Download the latest Binaries, release-build for Ant as a .ZIP file. Unzip the archive and note the directory that was created, e.g. c:\jakarta-ant-1.4.1. Note: In Windows 95, 98 and ME, you should rename Ant's directory so that it doesn't use a name longer than eight characters, for example c:\ant.
Then, using the technique used in an eariler step, update the PATH environment variable so it references Ant's "bin" directory. For example:
c:\jakarta-ant-1.4.1\bin;
Make sure the drive and directory match where you actually installed Ant.
Then define three new environment variables:
ANT_HOME=c:\jakarta-ant-1.4.1
JAVA_HOME=c:\j2sdk1.4.0
JBOSS_HOME=c:\JBoss-2.4.6
Please ensure that the drive and directories of these setting match where you installed Ant, the JSDK and JBoss
Note: In Windows 95, 98 and ME, you must use the "SET" command in autoexec.bat to define the environment variables. You should also reboot after saving your changes. Here's an example:
SET ANT_HOME=c:\ant
SET JAVA_HOME=c:\j2sdk1.4.0
SET JBOSS_HOME=c:\JBoss-2.4.6
To test the Ant installation, close any existing Command Prompt windows, then open a new Command Prompt and enter:
ant -version
You should see the version number of Ant.
Important: Print this document and mark it up with information as requested. You will need this setup information to do the labs.
Install the operating system. Be sure to install TCP/IP networking and give the computer a TCP/IP hostname.
Login in as the user under which you will do the labs (typically not "root"). Note the home directory into which you will install the software.
Install Netscape or Mozilla or other browser.
If you have not already done so, download the latest non-beta Java2 Standard Edition Software Development Kit (JSDK) and documentation package from http://java.sun.com/j2se. Install both the JSDK and the documentation package. Note the directory where the JSDK was installed, e.g. /usr/java/jsdk1.4.0. Be sure to read the Installation Instructions on the Sun web page.
Note: Be sure to download the SDK, not the JRE.
Use vi or other editor to update your startup script (e.g .bashrc) so that the PATH environment variable includes the JSDK. Put the following string at the beginning of the PATH environment variable. Be sure to make sure this setting is correct for where you installed the JSDK (see previous step)!
/usr/java/jsdk1.4.0/bin:
To test the JSDK installation, open a new console and then enter:
java -fullversion
You should see the version number of the JDK that you installed. If that worked, test the Java compiler:
javac
You should a listing of Java compiler options. If not, refer to the Installation Notes on the Sun website. The most common problem is an incorrect PATH environment variable -- PATH should reference the "bin" directory of the JSDK.
Download the JBoss open-source, free EJB container from http://jboss.org/downloads.jsp
Warning: Be sure to download JBoss version 2.4.x instead of version 3.x. The labs currently do not support version 3.x. The zip file's name will be something like:
JBoss-2.4.6.zip
Use InfoZip or other unzip program to unzip the JBoss ZIP file onto your hard disk (we recommend unzipping to your home directory). Write down the directory where you installed JBoss as the JBoss Installation Directory.
_____________________________________________________
Now test JBoss to make sure it works correctly. In your console, change to the JBoss Installation Directory/bin directory and type:
sh run.sh
You should see a series of diagnostic messages. The last message should be something like:
[INFO,STDERR] JBoss-2.4.6 Started in 0m:11s.887
If not, look for troubleshooting hints on the JBoss website.
Edit your startup script again and add the following environment variable definitions:
export JAVA_HOME=/usr/java/jsdk1.4.0
export JBOSS_HOME=xxxx
where xxxx is the JBOSS Installation Directory. Make sure that the JAVA_HOME directory is correct for where you installed the JSDK.
Be sure to close your console after making these changes!
Determine the Lab Installation Directory. When you downloaded and installed the EJB Programming Workshop, you expanded the archive to a directory, e.g. /home/myusername/ejbclass. Write the Lab Installation Directory here:
_____________________________________________________
Install Jakarta Ant, which will make it easier for you to compile and deploy your EJBs.
Download Ant from:
Download the latest Binaries, release-build for Ant as a .tar.gz file. Unpack the archive and note the directory that was created, e.g. /home/mysername/jakarta-ant-1.4.1.
Then, using the same technique used in an eariler step, update the PATH environment variable so it references Ant's "bin" directory. For example:
/home/myusername/jakarta-ant-1.4.1/bin:
Make sure the directory matches where you actually installed Ant.
Then define a new environment variable:
export ANT_HOME=/home/myusername/jakarta-ant-1.4.1
Please ensure that the drive and directories of these setting match where you installed Ant and the JSDK.
To test the Ant installation, close any existing console windows, then open a new console and enter:
ant -version
You should see the version number of Ant.
Optionally install the JEditor text editor. The latest version is available from:
http://jedit.sourceforge.net/
Download the latest "final" version.
To install JEdit, follow the instructions given on the JEdit web page.