Sun Microsystems Logo

 

 
 

Sun[tm] ONE Application Server 7
Setting Up Your Environment
PREV START NEXT

 

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 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[tm] 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.

Warning Note IconWindows Users : 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. Start a command console by selecting Start->Run....
  2. Enter the name "cmd" in the Open: text entry area and press the enter key or click on OK.
  3. As the console starts, type the command net at the command prompt. If the command is not found, then you need to 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 and then proceed to the next task, Starting and Stopping the Application Server.

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

  » Setting the PATH Environment Variable on UNIX Platforms
  » Setting the PATH Environment Variable on Windows

Setting the PATH Environment Variable on UNIX Platforms

On UNIX systems, it is recommended that you add the application server's bin/ directory to your login profile such that 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 command asadmin at the command prompt.

You should observe the following result:

asadmin
Use "exit" to exit and "help" for online help
asadmin>_

Enter exit to exit the asadmin command. Leave the terminal window open for the next section.

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

Informational Note IconAdministrative Command Line Interface: The asadmin command is the administrative command line interface of the application server. By executing the asadmin command without arguments, you have entered the interactive mode of the command. You can type help at the asadmin> command prompt to see the complete list of subcommands supported via the command line interface. The asadmin command also fully supports the use of pre-built 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 Administrator's Guide.

Proceed to Starting and Stopping the Application Server.

Setting the PATH Environment Variable on Windows

On Windows, it is recommended that you modify the system PATH environment variable via the Windows control panel.

1. From the desktop, access Start->Settings->Control Panel

2. In the Control Panel, double click on the System object.

3. Once in the System object, click on the Advanced tab. Now click on Environment Variables...

4. The Environment Variables dialog 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. Either select the existing PATH entry and click on Edit... or click on New... to create a new PATH environment variable.

6. Add the value of the <install_dir>/bin; to the front of the PATH value. For example, add c:\Sun\AppServer7\bin; to the front of the variable value. Click OK to close the Edit User Variable dialog window.

7. The PATH variable should reflect the directory path that you just entered. Click on OK to apply the changes and to close the Environment Variables Window. Click OK to close the System Properties window.

8. Check your work by starting a command window and determining if the application server commands are available from the command line.

8a. From the Windows desktop, access Start->Run...

8b. Enter the command name cmd in the Open: text entry field and either press the Enter key or click OK.

8c. When the command window appears, enter the following command at the prompt: asadmin

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.

Informational Note IconAdministrative Command Line Interface: The asadmin command is the administrative command line interface of the application server. By executing the asadmin command without arguments, you have entered the interactive mode of the command. You can type help at the asadmin> command prompt to see the complete list of subcommands supported via the command line interface. The asadmin command also fully supports the use of pre-built 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 Administrator's Guide.

Enter exit to exit the asadmin command. Leave the command window open and proceed to the next section, Starting and Stopping the Application Server.

Troubleshooting Environment Settings

If the asadmin command is not recognized, then go back into the Control Panel and double check your PATH setting and try to execute asadmin 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 Starting and Stopping the Application Server.

PREV START NEXT