Configuring your environment

In this chapter, we will put all the pieces together to setup your complete J2EE platform. Note that you can find more detailed information in the documentation provided with each software. However, we will try to give all the necessary information so that you don't want to go deeply in all those documentations.

Setting up your Java environment

Once you have installed your Java SDK as described in the section called JavaTM2 Software Development Kit in the chapter called Getting and installing the software, you are now pretty much done ! The last step consist in setting your JAVA_HOME and updating your PATH environment variable.

JAVA_HOME must point to the directory where you installed the SDK and PATH must include the bin subdirectory of the DSK. Here are examples for Unix and Windows platforms:

Unix platforms.

  • Assuming that you installed the SDK in the /usr/local/jdk1.3.1 directory, you should issue a command like:

    bash>export JAVA_HOME=/usr/local/jdk1.3.1
    or
    tcsh>setenv JAVA_HOME /usr/local/jdk1.3.1

  • Then you have to update your path by appending /usr/local/jdk1.3.1/bin. If JAVA_HOME has been properly set, you can proceed as follow:

    bash>export PATH=${PATH}:${JAVA_HOME}/bin
    or
    tcsh>setenv PATH ${PATH}:${JAVA_HOME}/bin

Note

Environment variables must be correctly set at all time, so it is a common practice to insert these commands in your shell start file (.bashrc, .cshrc, ...).

Windows platforms.

  • Assuming that you installed the SDK in the C:\jdk1.3.1 directory, you should issue a command like:

    C:>set JAVA_HOME=C:\jdk1.3.1

  • Then you have to update your path by appending C:\jdk1.3.1\bin. If JAVA_HOME has been properly set, you can proceed as follow:

    C:>set PATH=%PATH%;%JAVA_HOME%\bin

    To update the path permanently, do the following according to your Windows version:

    Windows 95 or 98. You must insert this command in the AUTOEXEC.BAT file.

    Windows Me. Go to the Start Menu, then choose Programs, Accessories, System Tools and System Information. A window titled "Microsoft Help and Support" should appear. Select the Tools menu, and choose the System Configuration Utility. Go to the Environment tab where you can look for the PATH to edit. Append ;C:\jdk1.3.1\bin at the end of the path. Once you have changed and saved the value, you will be prompted for reboot.

    Windows NT. Go to the Start Menu, then choose Settings, Control Panel and select System. Select the Environment tab and look User Variables and System Variables for PATH. Then edit the value and append ;C:\jdk1.3.1\bin at the end.

    Windows 2000. Go to the Start Menu, then choose Settings, Control Panel and select System. Select the Advanced tab and look User Variables and System Variables for PATH. Then edit the value and append ;C:\jdk1.3.1\bin at the end.

    Windows XP. Go to the Start Menu, then double click on System. In the System Control Panel select the Advanced tab and push the Environment Variables button. Now, you can look for the PATH to edit. Append ;C:\jdk1.3.1\bin at the end of the path. Once you have changed and saved the value, you will be prompted for reboot.