Sun Studio

Getting started with Sun Studio: setting up your UNIX account
X Windows configuration setup for using Sun Studio IDE
Documentation for Sun Studio

The Sun Studio is a development environment for building, editing, debugging, source browsing, and tuning your C++, C, and Fortran software development projects. The Sun Studio includes:

  • Integrated text editors
  • Compilers
  • An integrated debugging service
  • A source code browser
  • Performance, source code management
  • GUI-building tools

The following documentation describes how to start using the Sun Studio and the Sun Studio interactive development environment (IDE) on Strauss, the central UNIX compute server at the University of Delaware. In addition, it describes how you might configure your UNIX account to create a more productive work environment when using Sun Studio. You are not required to follow these ease-of-use suggestions. However, they are strongly recommended because they minimize the typing needed to use Sun Studio features. In addition, this documentation generally assumes that you have made the suggested configuration changes.


Getting started with Sun Studio: setting up your UNIX account

The Sun Studio package is installed in the directory /opt. This installation directory will be referred to as $SUNSTUDIO throughout this document. It is important to note that Sun Studio and its language compilers are only available on Strauss.

There may be newer test versions of Sun Studio on Strauss. If you want to use a test version you must set the SUNSTUDIO environment variable to the version you want to use. You DO NOT need to set this variable if you want the default version.

Here are the environment variables which must be set to use a alternate Sun Studio version with its compilers.

SUNSTUDIO /opt/studio11
MANPATH ${SUNSTUDIO}/SUNWspro/man:/opt/man:/usr/man

This documentation assumes that your UNIX account's configuration ("dot") files match, or are based upon, the Client Support & Services recommended configuration files: .cshrc, .login, .localalias, and .localenv. These files are found in the /opt/proto directory. Typing the UNIX command


will cause your current configuration files to be renamed (for backup purposes) and replaced with the standard configuration files. The system will display the names of the renamed and replacement files.

Start a new shell for working with the Sun Studio package

The environment variables, listed above, will set your paths so that the Sun Studio commands, programming libraries, and on-line documentation are first in your path. In some cases, this replaces standard Unix commands with ones just for Sun Studio. We recommend that you always start a new shell with these environment variables. When you are done, type exit to get back to the default environment.

Configuration changes to identify the Sun Studio package location

Add following lines to your ~/.localenv file:

# For Sun Studio with IDE
#setenv SUNSTUDIO /opt/studio11

These are both comment commands. Remove the # before the setenv command to use the alternate version of Sun Studio. You may need to update the setenv command with a new Sun Studio location.

Configuration changes to add a studioshell command

Add the following lines to your ~/.localalias file:

alias studioshell "(setenv NEED_STUDIO; newgrp \!*)"
if $?NEED_STUDIO then
 unsetenv NEED_STUDIO
 if $?SUNSTUDIO then
   setenv PATH ${SUNSTUDIO}/SUNWspro/bin:$PATH
   setenv MANPATH ${SUNSTUDIO}/SUNWspro/man:/opt/man:/usr/man
 if $?DISPLAY then
   xset fp+ tcp/

The next time you log onto Strauss, you will be able to start an IDE-configured shell with the command


To associate the new shell with a different group project id (e.g., a UNIX group assigned to a class), type the following command instead:

studioshell project

where project is your 4-digit group project number.

Testing your new configuration

Once you have made the changes to both ~/.localenv and ~/.localalias files, logout and login again. To test your setup, type studioshell to start a new shell, and the use the man command and which command to check your paths for on-line documentation and compilers. Here is a sample session to test your setup.

<99>% studioshell
<1>% man intro
Reformatting page. Please Wait... done

User Commands intro(1)

 intro - introduction to Sun Studio command-line manual pages

 The Section 1 Sun Studio man pages include man pages for all
 the command-line applications delivered with the Sun Studio
 compilers and tools.

 A complete index can be found by pointing a browser at


 which assumes that the software has been installed in /opt

SunOS 5.9 Last change: July 2004 1

<2>% which CC

Command <1>% shows the man command is getting the expected to Sun Studio documentation, and command <2>% show the CC compiler is the correct version.


X Windows configuration setup for using Sun Studio IDE

This section assumes that you have already modified your UNIX configuration files as described in Getting Started with Sun Studio IDE: Setting Up Your UNIX Account. Further modifications to these configuration files, described below, will facilitate your use of Forte in an X Windows environment.

Launching Sun Studio IDE

When you are connected to Strauss from a X Window system. The following commands will start a shell, launch the Sun Studio IDE and then exit.

sunstudio &

The first time you run Sun Studio you should see this screen "Welcome" screen:

Click on the Setup Wizard to conifigure your IDE:

Choose the Swing HTML browser. Click Next >

The built in text editor is the best for new users. If you are already an expert in using emacs, or vi you may choose the Xemacs or GVim options.
Click Next >

Enable the Java module by setting the value in the Java row to "True." All the other modules are enabled by default. Click Finish.

Possible error message and warnings:

  • If you use the sunstudio command on Copland, you will get the message:
    sunstudio: Command not found.

    You must run sunstudio on Strauss.

  • If you try to launch sunstudio with no X11 server available for display, you will get the error message:

    Error: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.

    This is because your DISPLAY variable is not set.

  • You may receive warning messages when you launch sunstudio

    Warning: Cannot convert string "-monotype-arial ..." to type FontStruct

    This is because this font monotype-arial is not available. To make this font available, you can add the Strauss font server to your font path with the command:

    xset fp+ tcp/

    This should be done just once during your entire X session. It is best to add all required fonts or the Strauss font server to your font path automatically every time you start your X11 server. Consult your X11 server documentation to see how to do this.

  • The warning message

    Warning: Cannot convert string "MetaCtrl<Key>Insert" to type VirtualBinding

    means you do not have no mapping from the keysym Insert to a key on your keyboard. You can modify the keysym database to use any key on your keyboard. Again consult your X11 server documentation to see how to do this.

  • If you are upgrading from using a older version of Sun Studio you may get a message containing:

    An unexpected exception has occurred

    You may have been using a feature which has change in this version. We suggest you back up all your existing projects are remove the directory .sunstudio.

    \rm -r .sunstudio
    This will reset your account, and you when you next run sunstudio you will get the welcome screen with no projects in your "filesystem".

Modifing your .alias file

Add the following lines to the file called ~/.alias, which may not exist. These lines will create two new commands. The command studio will launch the Sun Studio IDE, and studiostrauss will launch

Sun Studio IDE on Strauss. The command studio will only work on Strauss; studio strauss will work on any Unix machine with ssh X tunnelling enabled.

if $?DISPLAY then
 alias studio "(setenv NEED_STUDIO; csh -c sunstudio)" 
 alias studiostrauss\
 ssh -Y -f 'setenv NEED_STUDIO\; csh -c sunstudio' 

These two new commands will automatically become defined when you start a new shell or open an new xterm window.

Connecting to Strauss from your local desktop

From your local desktop system

Start an X11 windows server
Local X Windows desktops such as, Gnome, KDE or CDE are based on X11 so you should not start a new X11 server. A Windows PC needs Hummingbird's Exceed X11 server. A Mac OS X desktop needs the optional X11 Package from Apple.
Use an SSH client to connect to Strauss
Type ssh -Y replacing username with your UDelNet ID. The ssh -Y options was introduced with openSSH 3.8. If you get an error message with this command on your machine used the older -X option. On a Windows PC use the University-supplied SSH client to connect to Strauss with X11 tunnelling enabled, and there is no need to type this command.
Use the above alias to open the Sun Studio IDE window.

These last two steps can be accomplished with one command:

ssh -Y -f 'setenv NEED_STUDIO; csh -c sunstudio'

Use this command to customize your desktop for quickly launching Sun Studio on Strauss.


Documentation for Sun Studio

The following documentation is available with this Sun Studio 11 release.

Online help. The online help available through the Help menu in the IDE provides task-oriented information on using all of the components of the IDE.

Readmes. These documents describe the new features, performance enhancements, problems and workarounds, and software corrections for this release of Sun Studio 9. The release notes might contain additional information on problems and workarounds.

Man pages. These on-line manual pages describe user commands, libraries that are supplied with the compilers, and other types of commands. Man pages contain reference information, including command syntax, usage, and related commands. You can use the man command to view man pages, or you can access these documents in HTML.

Sun Studio 11 manuals. You may get the Sun Studio 11 manuals in PDF format or HTML format on the site.

The Readmes, man pages, and pointers to the Sun Studio manuals are available in HTML format. After setting up your UNIX account as described above, you can view the Sun Studio documentation by opening the URL:

You must supply your UDelNet ID and password to get these documents.

Additional documentation available on the web


Search IT Help

My UD Search for forms & applications.