C H A P T E R  2

Installing the Sun Studio 11 Software

This chapter gives you instructions for installing your Suntrademark Studio 11 software.



Note - Do not use the pkgadd command to install the software. Use the provided installer.




Supporting Previous Sun Studio and Sun ONE Studio Releases

If you installed any other release of the Sun Studio software on your system, then install the Sun Studio 11 software in a different directory. If you have Sun Studio 10 update 1 Early Access software installed, be sure to uninstall this software before installing the Sun Studio 11 software.

After installation, modify your PATH and MANPATH environment variables to include the new directory. See Setting Up Access to the Developer Tools and Man Pages for more information about setting the variables to use the new release.


Installing from Electronic Download Files

If you obtained your Sun Studio 11 software through electronic download, you can find complete instructions for downloading the software file, extracting the file contents, and starting the product installers on the download page of the product web site at http://wwws.sun.com/software/products/studio/index.html. Follow the instructions in the Download Instructions before you proceed with product installation.


Choosing an Installation Method

There are four ways to install the Sun Studio 11 software:

The root (superuser) account that is used to install the Sun Studio software must have a Javatrademark 2 runtime environment (JRE) 1.4.0 or later in its PATH.

a. Download the 32-bit self-extracting JRE 1.4.2_10 binary from http://java.sun.com/j2se/1.4.2/download.html.

b. Follow the installation instructions at http://java.sun.com/j2se/1.4.2/jre/install-solaris.html to install the JRE software in any directory of your choice other than /usr/jdk.

c. Add the path to the JRE software to your PATH environment variabl



Note - The CD-ROM names are studio_11_solsparc and studio_11_solx86. In the examples provided, the CD-ROM name studio_11_solarch is used.




Using the Graphical User Interface Installer

These instructions describe how to install the Sun Studio 11 software using the graphical user interface installer available on the product CD-ROM. If you get the product from an electronic download, be sure to follow all instructions in the Download Instructions, which is available for download from the product web site download page.



Note - Do not use the pkgadd command to install the software. Use the provided installer. Do not run the installer in the background.



1. Decide if you want to install using a remote display. See Choosing Local Display or Remote Display of the Installer for details.

2. If you are not currently superuser (root), become a superuser by typing:


% su
Password: root-password



Note - The installer prompts you to log in as superuser (root) if you invoke the installer when you are not logged in as superuser (root).





Note - If you are installing the Sun Studio 11 software on a system running the Solaris 10 OS with zones, see Installing on a Solaris 10 System With Zones for important information about the correct procedure.



3. Insert the CD-ROM in the CD-ROM drive.

The product installer starts.

If the installer does not start or you are using the Solaristrademark 9 operating environment, the autorun feature might be disabled or unsupported on your system. In this case, use one of the following methods to start the installer:

The Welcome page opens.

4. (Optional for electronic download) If you downloaded the product tar file from the product web site, do the following:

a. See the Download Instructions available on the product web site download page for more information on uncompressing the tar file and extracting the contents.

b. From the download directory, start the installer by typing:


# ./installer

The Welcome page opens.

(Optional for using the Solaris Product Registry tool) You can start the installer by using the Solaris Product Registry tool.

a. To start the Product Registry tool, type:


# prodreg

b. Click New Install.

c. In the Select Installer dialog, navigate to the download directory or cdrom directory, and select installer.

d. Click OK, and the installer starts.

The Welcome page opens.

5. Click Next in the Welcome page.

The Initializing page is displayed, and when initialization is complete, the Software License Agreement page is displayed.

6. In the Software License Agreement page, click Accept.

If you choose Decline, you cannot continue with the installation.

7. Click Next to proceed to the Select Component page.

8. In the Select Component page, select the type of installation you want for each product.



Note - If you select Default Install for Solaris patches, the installer installs all of the required patches for the Sun Studio 11 software, which are listed in Appendix B. If you have previously installed these patches, installing the required patches does not downgrade your system.





Note - If you are installing the Sun Studio 11 software on a system running the Solaris 10 OS with zones, you must install the required patches in the global zone.



9. Click Next to proceed to the Select Install Directory page.

10. Decide whether you want to change the software installation directory from /opt.

See Supporting Previous Sun Studio and Sun ONE Studio Releases if you want to install this new Sun Studio release on a computer that contains previous Sun Studio releases, Sun ONE Studio releases, or Forte Developer releases.

11. Click Next when you have entered the installation directory.

If you did not select Custom Install for any of the products, skip to Step 12.

(Optional for Custom Install) If you selected Custom Install for any of the products in the Product Selection page, a Subcomponent Selection page is displayed for each of those products.

a. Select the subcomponents you want to install by clicking the check box next to the item.

Items with a check mark in the box will be installed.

b. Click Next to continue with installation.

The installer checks for adequate disk space, and the Ready to Install page appears.

12. Verify that the disk space shown at the top of the Ready to Install page is available on your system by using the df -k command. If you receive a disk space error message and you have sufficient disk space to install the product, then ignore the error message and continue with installation.

13. In the Ready to Install page, confirm that the items you want to install are listed.

The Installing page appears with a progress indicator. When installation is complete, the Installation Summary page appears.

14. If you want to view the installation log file for a product, click the Details button for that product in the Installation Summary page.

15. In the Registration page, read the information about registering the product and click Next.

16. In the After Installation page, read the information about the log files and how to run the product.

17. Click Exit to finish the Sun Studio 11 software installation.

18. Remove the CD-ROM from the CD-ROM drive.

19. (Optional) If you performed the installation using a remote display, on the display computer, disable client access by typing the following:


# xhost - source-computer-name

20. Exit from superuser privileges on the source computer by typing:


# exit

21. To set up your access to the Sun Studio 11 software tools and man pages, set your PATH and MANPATH variables by following the steps in Setting Up Access to the Developer Tools and Man Pages.

22. If you use a proxy server to access the Internet, set the ALL_PROXY environment variable to your proxy settings so that you can use the Update Notification feature of the Sun Studio 11 software. For information about setting your proxy and about the Update Notification feature, see Setting Your Proxy Information for Using the Update Notification Feature


Using the Command-Line Installer

These instructions describe how to install the Sun Studio 11 software using the command-line interface.



Note - Do not use the pkgadd command to install the software. Use the provided installer. Do not run the installer in the background.



1. Decide if you want to install using a remote display. See Choosing Local Display or Remote Display of the Installer for details.

2. If you are not currently superuser, become a superuser (root) by typing:


% su
Password: root-password



Note - The installer prompts you to log in as superuser (root) if you invoke the installer when you are not logged in as superuser (root).



3. Insert the CD-ROM in the CD-ROM drive.

If the GUI installer starts, choose Exit to exit from the installer. To restart the installer in the command line, type:


# /cdrom/studio_11_solarch/installer -nodisplay

4. (Optional for electronic download) If you downloaded the product file from the product web site, do the following:

a. See the Download Instructions available on the product web site download page for more information on uncompressing the tar file and extracting the contents..

b. From the download directory, start the command-line installation by typing:


# /download-directory/installer -nodisplay

Do not run the installer in the background.

5. The installer welcomes you. Enter to continue.

The Software License Agreement text is displayed.

6. The Enter key is equivalent to the Return key on some keyboards. Press the Enter key to accept the default selections during installation.

7. Follow the installer instructions to complete the installation. See Step 10 in Using the Graphical User Interface Installer for additional information about selecting the installation directory.

8. When installation is complete, you can view a product's log file by typing the number that corresponds to that product. When you finish viewing the log files, type the number that corresponds to Done.

9. Remove the CD-ROM from the CD-ROM drive.

10. (Optional) If you performed the installation using a remote display, on the display computer, disable client access by typing the following:


# xhost - source-computer-name

11. Exit from superuser privileges on the source computer by typing:


# exit

12. To set up your access to the Sun Studio 11 software tools and man pages, set your PATH and MANPATH variables by following the steps in Setting Up Access to the Developer Tools and Man Pages.

13. If you use a proxy server to access the Internet, set the ALL_PROXY environment variable to your proxy settings so that you can use the Update Notification feature of the Sun Studio 11 software. For information about setting your proxy and about the Update Notification feature, see Setting Your Proxy Information for Using the Update Notification Feature


Using the Batch Installer

You can install the Sun Studio 11 software, Sun Performance Librarytrademark software, or Sun Studio Source Distribution software with the batch installer for a default installation.



Note - Do not use the pkgadd command to install the software. Use the provided installer. Do not run the installer in the background.



Follow these instructions for batch installation:

1. Decide if you want to install using a remote display. See Choosing Local Display or Remote Display of the Installer for details.

2. If you are not currently superuser, become a superuser (root) by typing:


% su
Password: root-password

3. Use the following command to run the batch installer:


batch_installer [-d dirname | -R root-path] [-h] 

See TABLE 2-1 for the options that are available for the batch_installer command.


TABLE 2-1 batch_installer Options and Option Descriptions

Option Name

Option Description

-d dirname

Installs in directory dirname.

-R root-path

Specifies the absolute path for the root system and product. Use this option in JumpStart installation to set the root directory. NOTE: Use this option only with the batch installer.

-h

Displays usage information for the batch_installer command.


The batch_installer command and the options can be used in the scenarios shown in TABLE 2-2


TABLE 2-2 Installation Scenarios Using the batch_installer Command and Options

Scenario

Command Typed at the Prompt

Install in the default directory

#./batch_installer

Install in a directory other than the default directory

#./batch_installer -d /dirname

Install and change the root installation

#./batch_installer -R /a/opt


4. Choose the appropriate installation scenario from TABLE 2-2 to run the batch_installer command. For example, to use the options to install in a directory other than the default, type the following:


# /cdrom/./batch_installer -d /dirname

The Software License Agreement is displayed, and the installer checks for adequate disk space. The installer proceeds with installation, and the prompt returns when installation is complete.

(Optional for electronic download) If you downloaded the product files from the product web site, type the following:


# /download-directory/install-directory/batch_installer -d /dirname

5. (Optional) If you performed the installation using a remote display, on the display computer, disable client access by typing the following:


% xhost - source-machine-name

6. Exit from superuser privileges on the source computer by typing:


# exit

7. Set your PATH and MANPATH variables. See Setting Up Access to the Developer Tools and Man Pages.

8. If you use a proxy server to access the Internet, set the ALL_PROXY environment variable to your proxy settings so that you can use the Update Notification feature of the Sun Studio 11 software. For information about setting your proxy and about the Update Notification feature, see Setting Your Proxy Information for Using the Update Notification Feature


Using the Solaris JumpStart Installer

You can use the Solaris JumpStarttrademark installer on at least the Solaris 9 OS on SPARC® based systems and on at least the Solaris 9 OS on x86 based systems to automate the software installation process to install the Sun Studio 11 software on multiple systems. An overview of the JumpStart installation steps is listed below. See the Solaris Installation Guide for complete details of JumpStart installation.



Note - In the following instructions, substitute the download directory name for the cdrom_path that is used in the command-line examples.



1. Verify that you have more than one gigabyte of disk space in both the swap partition and the /opt partition on the source machine.

2. (Optional for electronic download users) Copy the downloaded file into the $SI_CONFIG_DIR directory.

3. Create a finish script that resides on the source machine. The file must contain the following information:


#! /bin/sh
cd $SI_CONFIG_DIR/cdrom_path
./batch_installer -R /a



Note - The batch_installer -d option does not work in JumpStart installation.



See Using the Batch Installer for information on the available batch_installer command options.

Refer to the Solaris Installation Guide for further instruction on completing the JumpStart installation process.


Installing the J2SE Platform and Related Solaris Operating System Patches

The Sun Studio 11 Integrated Development Environment (IDE) supports the Javatrademark 2 Platform, Standard Edition technology (the J2SEtrademark technology) and related Solaristrademark Operating System (OS) patches.

If you have the supported J2SE technology installed on your system, then the J2SE selection is not visible in the Select Components page of the installer.

If you do not have the supported J2SE technology installed on your system, then you can install the technology on your system by using one of these installers:


Verifying a Successful Installation

Once the installation is completed, you can use any of the following methods to verify a successful installation:

a. Go to the logs directory by typing at the prompt:


% cd /var/sadm/install/logs

b. View the file by typing:


% more Sun_Studio_Software_install.A03200125

The file extension varies for each log file.


Setting Up Access to the Developer Tools and Man Pages

Because the Sun Studio 11 software product components and man pages are not installed into the system directories /usr/bin/ and /usr/share/man, you must change your PATH and MANPATH environment variables to enable use of the Sun Studio 11 software.



Note - The paths shown in this section assume that Sun Studio 11 packages are installed in the default /opt directory. If you installed the software in a different directory, replace /opt in the examples with that directory name.



Set the PATH and MANPATH variables in your home environment files. In the examples that follow, the .cshrc file is shown if you are using the C shell, and the .profile file is shown if you are using the Bourne shell or Korn shell.

For more information about the PATH and MANPATH environment variables, the SunOStrademark man page csh(1) describes the PATH variable for the C shell, the sh(1) man page describes the PATH variable for the Bourne shell, and the ksh(1) man page describes the PATH variable for the Korn shell. The man(1) man page describes the MANPATH variable.

Setting Your PATH Environment Variable So You Can Access Sun Studio 11 Tools

To use the Sun Studio 11 software commands, your PATH environment variable must contain the path /opt/SUNWspro/bin. To determine whether you need to set your PATH environment variable, follow these steps:

1. Display the current value of the PATH variable by typing:


% echo $PATH

2. Review the output for a string of paths that contain /opt/SUNWspro.

3. Add the path /opt/SUNWspro/bin to your PATH environment variable. If you have previous versions of Sun Studio, Sun ONE Studio, or Forte Developer software installed, add the path before the paths of the previous installations.



Note - Substitute your home environment file name for the file names shown in the examples.



Setting Your MANPATH Environment Variable So You Can Access Sun Studio 11 Man Pages

To access Sun Studio 11 man pages with the man command, your MANPATH environment variable must contain the path /opt/SUNWspro/man. To determine whether you need to set your MANPATH environment variable, follow these steps:

1. Request the dbx(1) man page by typing:


% man dbx

2. Review the output, if any.

If the man dbx command cannot find the dbx(1) man page, or if the page that is displayed is not for the version of the software you just installed, you do not have the MANPATH variable set correctly. Set your PATH variable as described in the next step.

3. Add the path /opt/SUNWspro/man/ to your MANPATH environment variable.

Adding the Changes to the Appropriate Environment Variable

The following procedure lets you permanently add the paths for the Sun Studio 11 software tools and man pages to the appropriate environment variables so that all Sun Studio 11 components are always available. These commands can also be entered at a shell prompt to temporarily enable that shell only.

1. Add the Sun Studio 11 software to your PATH and MANPATH variables.



Note - The PATH and MANPATH variables must be set to include Sun Studio 11 software in each user's environment, which allows each user to use the installed software.



If the response is "Undefined variable" (C shell) or an empty line (Bourne shell or Korn shell), the MANPATH variable is not set. If paths to one or more man directories are displayed, the variable is set.

Now edit the .cshrc file in your home directory and add the following line at the end of the file:


set path=(/opt/SUNWspro/bin  $path)

If the MANPATH variable is not already set, add the following line:


setenv MANPATH /opt/SUNWspro/man:/usr/share/man

If the MANPATH variable is already set, add the following line instead:


setenv MANPATH /opt/SUNWspro/man:$MANPATH

Do not type any spaces in these two lines.

2. Save the .cshrc file or .profile file that you modified in Step 1.

3. Reinitialize your shell by executing the following command:

For the C shell, type:


source ~/.cshrc

For the Bourne shell or Korn shell, type:


. ~/.profile


Setting Your Proxy Information for Using the Update Notification Feature

The Update Notification feature periodically checks www.sun.com and communicates available changes related to your Sun Studio software, including patches and major software updates.

You can view the current contents of the update file from the IDE by choosing Help right arrow View update information.

To initiate contact with the server and get updated information, choose Helpright arrow Check now for updates.

From the command line, you can view the update file at ~/.sunstudio/user_info/latest_updates.html.

If Update Notification is not able to check for updates and your system is on a network with a proxy server, you can set proxy server information by doing the following:

1. Choose Tools right arrow Setup Wizard.

2. In the wizard, select the Use HTTP Proxy Server checkbox.

3. Type the proxy host name in the Proxy Server Name field and the port number in the Port field.

4. Click Finish.

You can also set the proxy server information using the ALL_PROXY environment variable; for example:


setenv ALL_PROXY myproxy:8080



Note - You must exit and restart the IDE for the proxy server information to be recognized by the IDE.



To disable Update Notification, set the SUNW_NO_UPDATE_NOTIFY environment variable to any value other than false.

Usage information is communicated during the Update Notification process. This information is used by Sun Microsystems to improve future Sun Studio software releases. This information is anonymous and cannot be associated to any individual or organization.