C H A P T E R  2

Installing the Sun Studio 10 Software

This chapter gives you instructions for installing your Suntrademark Studio 10 software and serial number.



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 10 software in a different directory. If you have Sun Studio 10 Early Access software or Sun Studio 10 Customer Acceptance software installed, be sure to uninstall this software before installing the Sun Studio 10 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.


Upgrading From Try and Buy Software

When you upgrade from Try and Buy software to purchased software, you do not need to reinstall the software product. You only need to install your permanent serial number. The Serial Number Installation Tool (snit) is a utility that works from the command line and is used to display the contents of a license file and to install serial numbers into the license file.

Follow the steps below to install your permanent serial number.

1. Locate the permanent serial number. See Locating the Product Serial Number.

2. Become a superuser (root) by typing:


% su
Password: root-password

3. Use the snit command to enter your serial number by typing:


% /install-directory/SUNWspro/bin/snit -i serial-number -f /install-directory/SUNWspro/prod/lib/serial.dat

The serial number is installed in the serial.dat file of your product. Refer to the snit(1) man page for more details about the snit command options.


Installing from Electronic Download Files

If you obtained your files through electronic download, you can find complete instructions for downloading and extracting the downloaded files 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 10 software:



Note - If the installer cannot find the required J2SE technology, then run the installer using the -j option with the following syntax: ./installer -jdkhome /usr/jdk.





Note - The CD-ROM names are studio_10_sol_sparc and studio_10_sol_x86. In the examples provided, the CD-ROM name studio_10_sol_arch is used.




Using the Graphical User Interface Installer

These instructions describe how to install the Sun Studio 10 software and serial number 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).



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.

(Optional for electronic download) If you downloaded the product files 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 extracting the tar files and using the installer launch script.

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.

4. Click Next in the Welcome page.

The Initializing page appears, and when initialization is complete, the Binary Code License Agreement page appears.

5. In the Binary Code License Agreement page, click Accept.

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

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

7. 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 10 software, which are listed in Appendix B. If you have previously installed these patches, installing the required patches does not downgrade your system.



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

9. 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 ONE Studio releases or Forte Developer releases.

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

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

(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.

11. In the Enter Serial Number page, click the 60-day Trial Serial Number button to generate the 60-day trial serial number or enter your permanent serial number in the text box. See Locating the Product Serial Number for information on finding the serial number.

12. Click Next to install the serial number.

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

13. 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.

14. 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.

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

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

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

18. Click Exit to finish the Sun Studio 10 software installation.

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

20. (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

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


# exit

22. To set up your access to the Sun Studio 10 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.


Using the Command-Line Installer

These instructions describe how to install the Sun Studio 10 software and serial number 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_10_sol_arch/installer -nodisplay

4. (Optional for electronic download) If you downloaded the product files 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 extracting the tar files and using the installer launch script.

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. Press Enter to continue.

The Binary Code License Agreement text appears.



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



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

7. 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.

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

9. (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

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


# exit

11. To set up your access to the Sun Studio 10 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.


Using the Batch Installer

You can install the Sun Studio 10 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 [-s serial number] [-d dirname | -R root-path] [-h] 

(Optional for electronic download) Use the following command to run the batch installer:


batch_installer_component-name [-s serial number] [-d dirname | -R root-path] [-h] 

The batch installer commands for each component are the following:

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

-s serial number

Installs the permanent serial number. Without this option, a 60-day trial serial number is generated by default.

-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 and generate a 60-day trial serial number by default

#./batch_installer

Install in the default directory with the permanent serial number

#./batch_installer -s serial number

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 generate the 60-day Trial serial number and install in a directory other than the default, type the following:


# /cdrom/studio_10_sol_arch/batch_installer -d /dirname

The Binary Code License Agreement appears, 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.


Using the Solaris JumpStart Installer

You can use the Solaris JumpStarttrademark installer on at least the Solaristrademark 9 operating system (SPARC® Platform Edition) and on at least the Solaristrademark 9 operating system (x86 Platform Edition) to automate the software installation process to install the Sun Studio 10 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 10 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:

See the Download Instructions available on the product web site download page for more information on extracting the tar file. Follow the instructions in Using the Graphical User Interface Installer to install the J2SE technology.


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 10 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 10 software.



Note - The paths shown in this section assume that Sun Studio 10 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 10 Tools

To use the Sun Studio 10 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 10 Man Pages

To access Sun Studio 10 software 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 10 software tools and man pages to the appropriate environment variables so that all Sun Studio 10 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 10 software to your PATH and MANPATH variables.



Note - The PATH and MANPATH variables must be set to include Sun Studio 10 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