Sun Management Center 4.0 Installation and Configuration Guide

Java Environment Variables and Path

The JAVA_HOME and PATH environment variable must be set on Solaris systems in order for the Sun Management Center 4.0 installation wizards, the setup wizards and the Java console to function properly. Similarly, the Microsoft Windows %PATH% must be modified to include the path to the JDK software for the Sun Management Center Java console to work properly on Microsoft Windows.

If the environment variables and path are not set properly, installation and setup of Sun Management Center 4.0 can fail.

ProcedureTo Set JAVA_HOME and PATH on the Solaris Platform

You must set the JAVA_HOME and PATH environment on the Solaris platform if the JDK 1.5 software has been installed in the default location on your system.

  1. Log in as root by typing su - root.

  2. Set JAVA_HOME to /usr/j2se.

    • In a C shell environment:


      # setenv JAVA_HOME /usr/j2se
      
    • In a Bourne or Korn shell environment:


      # JAVA_HOME=/usr/j2se
      # export JAVA_HOME
      

    Tip –

    Add the appropriate statement to your .login or .cshrc file.


  3. Add /usr/j2se/bin to your system path.

  4. Place /usr/j2se/bin in your PATH before /usr/bin.

  5. Place /usr/bin in your PATH before /usr/ucb.

ProcedureTo Set PATH on Microsoft Windows 2000

  1. Choose Start -> Settings -> Control Panel.

  2. Double-click System.

  3. Select the Advanced tab and then Environment Variables.

    The Environment Variables window is displayed.

  4. Click Path in the User Variables and System Variables and click Edit.

    The Edit System Variable window is displayed.


    Note –

    The Edit System Variable window shows the Microsoft Windows root directory using the environment variable %SystemRoot%.


  5. Add the location of the JDK bin directory to the PATH statement.

    For example, if the PATH statement shown in the Edit System Variable window is %SystemRoot%\system32;%SystemRoot%, the new path statement would then be %SystemRoot%\system32;%SystemRoot%;c:\j2version-number\bin where version-number is the JDK version.

    For example:

    %SystemRoot%\system32;%SystemRoot%;c:\j2sdk1.5\bin

    Separate each directory in the PATH statement with a semicolon as shown.

  6. Click OK to successively close each window.

ProcedureTo Set PATH on Microsoft Windows XP

  1. Choose Start -> Settings -> Control Panel.

  2. Double-click System.

  3. Select the Advanced tab and then Environment Variables.

    The Environment Variables window is displayed.

  4. Click Path in the User Variables and System Variables and click Edit.

    The Edit System Variable window is displayed.


    Note –

    The Edit System Variable window shows the Microsoft Windows root directory using the environment variable %SystemRoot%.


  5. Add the location of the JDK bin directory to the PATH statement.

    For example, if the PATH statement shown in the Edit System Variable window is %SystemRoot%\system32;%SystemRoot%, the new path statement would then be %SystemRoot%\system32;%SystemRoot%;c:\j2version-number\bin where version-number is the JDK version.

    For example:

    %SystemRoot%\system32;%SystemRoot%;c:\j2sdk1.5\bin

    Separate each directory in the PATH statement with a semicolon as shown.

  6. Click OK to successively close each window.

ProcedureTo Set PATH on Linux

  1. Change to your home directory.

    cd $HOME

  2. Open the .bashrc file.

  3. Add the following line to the file. Replace the JDK-directory with the name of your Java installation directory.

    export PATH=/usr/java/JDK-directory/bin:$PATH

  4. Save the file and exit.

    Use the source command to force Linux to reload the .bashrc file which normally is read only when you log in each time.

    source .bashrc


    Note –

    Note that if you wish to set the PATH for all users, you need to log in as root in the bash shell and perform the above steps on the .profile file in the etc directory and not the .bashrc file in the home directory.