Sun ONE logo      Previous      Contents      Index      Next     

Sun ONE Application Server 7 Getting Started Guide

Chapter 3
Setting Up Your Environment

After installation of the application server, one of the first steps is to configure your environment to include the application server’s bin/ directory.

This section contains the following topics:


About the PATH Environment Variable

This section addresses how to add the following directory to your PATH environment variable:

install_dir/bin

This is the only environment setting needed to run the asadmin command, the application server’s administrative command-line utility, and to access the asant utility to work with the sample applications.

If you are using the application server installation that was installed as part of a Solaris 9 installation, then you must include the directory /usr/appserver/bin in your PATH in order to access the asant utility. Additionally, if your PATH does not include /usr/sbin, inclusion of /usr/appserver/bin in your PATH ensures that you have access to the asadmin command-line interface.


Note

On some Windows 2000 systems, the Windows net command is not automatically made available to the environment through the system PATH environment variable. You must ensure this Windows utility is available in the environment in order to start and stop the application server.

To determine whether or not the net command is available in your environment, perform the following steps:

  1. Click the Windows Start button, then choose Run.... to launch a command console window.
  2. In the Open field, type cmd and click OK.
  3. As the console starts, type net at the command prompt. If the command is not found, you must modify the system PATH environment variable to include your Windows_install_root>\system32 directory. For example:

    C:\WINNT\system32;

If you are unfamiliar with setting the system's PATH environment variable, see the section below for detailed instructions.


If you are familiar with the process of setting environment variables, do so now in your own environment.

After setting your PATH variable, ensure that the asadmin command can be found, then proceed to "Starting and Stopping the Application Server." If the command is not found, check your PATH setting, refresh your environment settings, and execute asadmin again.

Otherwise, select one of the following paths depending on your platform:


Setting the PATH Variable on UNIX

On UNIX systems, it is recommended that you add the application server's bin directory to your login profile so it is automatically added to your environment's PATH setting during login.

Once you have set the PATH environment and refreshed your environment, execute the asadmin command at the command prompt.

The following result should appear:

asadmin

Use "exit" to exit and "help" for online help

asadmin>_

Type exit to quit the Administration command-line interface. Leave the terminal window open for the next chaptersection of this tutorial, "Starting and Stopping the Application Server".

If the command is not found, check your PATH setting, refresh your environment settings, and execute asadmin again.


Note

The asadmin command launches the Administration command-line interface of the application server. By executing the asadmin command without arguments, you have entered the interactive mode of the command-line interface.

You can type help at the asadmin command prompt to see the complete list of subcommands supported by the command-line interface.

The asadmin command also fully supports the use of prebuilt command files as a means of automating server administration and monitoring. In this guide, since you will be using only a small subset of these commands, you are encouraged to review the command line interface section of the Sun ONE Application Server Administrator's Guide.



Setting the PATH Variable on Windows

On Windows, it is recommended that you modify the system PATH environment variable via the Windows control panel as described in the following steps:

  1. Click the Windows Start button, choose Settings, then Control Panel.
  2. In the Control Panel, double-click System.
  3. Click on the Advanced tab, then choose Environment Variables...
  4. The Environment Variables dialog box lists the environment variables that apply to your current user account as well as to the system as a whole.

    In this exercise, you will modify the PATH environment variable for your current user account.

  5. Select the existing PATH entry and click Edit or click New to create a new PATH environment variable.
  6. Add the install_dir/bin value to the beginning of the PATH value.
  7. For example, add C:\Sun\AppServer7\bin; to the front of the variable value.

  8. Click OK to close the Edit User Variable dialog window.
  9. The PATH variable should reflect the directory path that you just entered.

  10. Click OK to apply the changes and to close the Environment Variables Window, then click OK to close the System Properties window.
  11. Check your work by starting a command window and determining if the application server commands are available from the command line:
    1. Click the Windows Start button, then choose Run.
    2. In the Open field, enter cmd and click OK.
    3. When the command window appear, type asadmin at the command prompt.
    4. After execution of the asadmin command, you should see the following result:

      C:\>asadmin

      Use "exit" to exit and "help" for online help

      asadmin>

      If you see this result, then you have verified that the application server command line utilities are accessible via your path setting.


      Note

      The asadmin command launches the Administration command-line interface of the application server. By executing the asadmin command without arguments, you have entered the interactive mode of the command-line interface.

      You can type help at the asadmin command prompt to see the complete list of subcommands supported by the command-line interface.

      The asadmin command also fully supports the use of prebuilt command files as a means of automating server administration and monitoring. In this guide, since you will be using only a small subset of these commands, you are encouraged to review the command line interface section of the Sun ONE Application Server Administrator's Guide.


  12. Type exit to quit the Administration command-line interface.
  13. Leave the command window open and proceed to the next chapter, "Starting and Stopping the Application Server". If the command is not found, check your PATH setting, refresh your environment settings, and execute asadmin again.


Troubleshooting Environment Settings

If the asadmin command is not recognized, go back into the Control Panel as described in Step 2, check your PATH setting, and try to execute the asadmin command again. Once you have fixed the PATH setting, ensure that you start a new command window to test execution of the asadmin command. Only a new command window will pick up the environment variable change. You will encounter the following message when your PATH variable is not set correctly:

C:\>asadmin

'asadmin' is not recognized as an internal or external command, operable program or batch file.

C:\>

Proceed to the next chapter "Starting and Stopping the Application Server."



Previous      Contents      Index      Next     


Copyright 2003 Sun Microsystems, Inc. All rights reserved.