How to Develop Code from a Remote Desktop with Oracle Solaris Studio

by Igor Nikiforov

This article describes the remote desktop feature of the Oracle Solaris Studio IDE, and how to use it to compile, run, debug, and profile your code running on remote servers.


Published May 2012

Introducing the IDE Desktop Distribution
Determining Whether You Need the Desktop Distribution
Creating the Desktop Distribution
Using the Desktop Distribution
See Also
About the Author

Introducing the IDE Desktop Distribution

Sun Studio 12 Update 1 introduced a unique remote development feature that allows you to run just one instance of the IDE while working with multiple servers and platforms. For example, you could run the IDE on an x86-based laptop or desktop running Oracle Linux, and use a SPARC-based server running Oracle Solaris 10 to compile, run, debug, and profile your code. The IDE works seamlessly just as if you had the Oracle Solaris operating system on your laptop or desktop.

If you'd like to download software, participate in forums, and get access to other technical how-to goodies in addition to content like this, become an OTN member. No spam!

 

In Oracle Solaris Studio 12.3, a new feature lets you create a special distribution of the IDE and Code Analyzer that is designed to run on user desktop systems, such as Microsoft Windows, and access remote servers running Oracle Solaris or Linux operating systems. The IDE and Code Analyzer desktop distribution tools run on your desktop system and connect to compilers and tools running on a remote Oracle Solaris or Linux system, enabling you to do full-fledged development on that remote system. You can think of the desktop distribution as IDE and Code Analyzer tools that are specially tuned to work in remote mode (source files residing on the desktop system) and full remote mode (source files residing on the remote system).

You can run a desktop distribution of the IDE on a system that has one of the following operating systems and the Java SE Development Kit (JDK) 6 Update 24 or later installed.

  • Microsoft Windows XP Professional SP3, Microsoft Windows Vista SP1, or Microsoft Windows 7 Professional
  • Ubuntu 9.10 or a later Ubuntu update
  • Macintosh OS X 10.5 or a later Macintosh OS X update

Determining Whether You Need the Desktop Distribution

If you have ever experienced slow response from the IDE running on a server that was heavily used and shared among a large development group, then you will want to try the desktop distribution. The desktop distribution provides advantages if you are in one of the following situations:

  • If you are running the Oracle Solaris Studio IDE on a remote system using X-Window forwarding or Virtual Network Computing (VNC), the desktop distribution is a good alternative. Most of your IDE settings will be exported from your remote IDE to the desktop distribution. And all the open projects in your remote IDE will be available as full remote projects in the desktop distribution.
  • If you want to start developing Oracle Solaris applications using Oracle Solaris Studio, but your system is not running Oracle Solaris, the desktop distribution will allow you to use your favorite desktop operating system to develop Oracle Solaris applications on remote systems.
  • If you are developing your applications in a POSIX environment and then porting them to Oracle Solaris, the desktop distribution will allow you to develop directly on Oracle Solaris without changing your desktop.

Creating the Desktop Distribution

You can create your desktop distribution in several ways:

The IDE is always included in the distribution. If you have the Code Analyzer installed, it is also included in the distribution.

Creating the Distribution from the IDE

To create the desktop distribution from the IDE, do the following:

  1. Start the IDE on the server where Oracle Solaris Studio 12.3 is installed, using a remote display (X-Window forwarding or VNC).
  2. In the IDE, choose Tools -> Create Desktop Distribution.

    Figure 1

    Figure 1. IDE Window Showing Create Desktop Distribution Menu Item

  3. Specify the directory on the remote file system to which you want to save the desktop distribution zip file.

    Figure 2

    Figure 2. Choose Where to Save the Desktop Distribution Archive Should Be Saved

  4. When the progress indicator in the lower right corner of the IDE window indicates that the zip file generation is complete, download the zip file to your desktop system and unzip it.

    Figure 3

    Figure 3. Desktop Distribution Successfully Created

When you unzip the desktop distribution zip file on your desktop system and start the IDE, it will recognize the server on which you generated it as a remote host and, by default, use the Oracle Solaris Studio compilers and tools on that host.

Creating the Distribution from the Command Line

You can create the desktop distribution zip file by using the solstudio command on a system where Oracle Solaris Studio 12.3 is installed.

% solstudio --generate-desktop-distr path [--userdir path | --without_user_data]

If you specify the --userdir option, the desktop distribution of the IDE that is generated includes the user profile data (IDE settings and open projects) from the specified user directory. You should specify this option if your user directory is not stored in the default location and you want to include the user profile data.

Tip: To determine the location of your IDE user directory, choose Help -> About in the IDE. The About window shows the userdir path as well as the version of Oracle Solaris Studio, Java, and the operating system.

If your user directory is at the default location, the user profile information is included automatically in the desktop distribution even if you do not specify the --userdir option. In the Oracle Solaris Studio 12.3 release, the default user directory location is $HOME/.solstudio/ide-12.3-platform-arch.

If you specify the --without-user-data option, the generated desktop distribution does not include any user profile data.

For example, the following command creates the desktop distribution file /shared/distros/dd.zip after collecting the user profile information from studiodir in your home directory.

% solstudio --generate-desktop-distr /shared/distros/dd.zip --userdir $HOME/studiodir

Creating the Distribution from the Oracle Solaris Studio 12.3 Package Installer

You can generate the desktop distribution zip file when you install Oracle Solaris Studio 12.3 with the package installer in Oracle Solaris 10.

  • If you are using the GUI installer and you are installing the IDE component of Oracle Solaris Studio, then on the Oracle Solaris Studio Installation page of the installer, select the Generate Desktop Distribution during installation checkbox so it contains a check mark. The generated desktop distribution zip file is placed in the lib directory in your Oracle Solaris Studio installation.
  • If you are using the non-GUI installer and you are installing the IDE component, include the -generate-desktop-distr option when you start the installer. The generated desktop distribution zip file is placed in the lib directory in your Oracle Solaris Studio installation.

Note: The default installation directory is /opt/solarisstudio12.3 on Oracle Solaris platforms and it is /opt/oracle/solarisstudio12.3 on Linux platforms.

The desktop distribution generated by the installer does not contain any IDE settings or open projects, but when you unzip it and run the IDE on your desktop system, the IDE will recognize the server on which you generated the distribution as a remote host, and it will access the tool collection in your Oracle Solaris Studio installation.

Using the Desktop Distribution

To install and use the desktop distribution, do the following:

  1. Unzip the desktop distribution zip file in the location on your desktop system where you want the IDE binary to reside.
  2. Navigate to the solstudio/bin directory in the location where you unzipped the file.
  3. Start the IDE from this directory using the solstudio command on Linux and Mac OS X systems or using the solstudio.exe command on Microsoft Windows systems.
  4. If your desktop distribution includes the Code Analyzer, start the Code Analyzer from the codeanalyzer/bin directory using the codeanalyzer command on Linux and Mac OS X systems or using the codeanalyzer.exe command on Microsoft Windows systems.

Now you can simply continue your development as if the IDE was running on a server, but with much better response time. The remote server where you created the desktop distribution is already configured in the IDE as the default build host. All your open projects and files, and recent projects and files, are known to the IDE, just as they were when you ran the IDE on the server. You can choose File -> Open Remote C/C++ Project and File -> Open File From to access and use files and projects that are located on the remote server.

See Also

See the following resources for more information:

About the Author

Igor Nikiforov has been working for Oracle and Sun Microsystems for more than four years. His current responsibilities include development of the Oracle Solaris Studio IDE and NetBeans. Before Oracle, Igor developed enterprise applications including some municipal IT projects for the city of Saint Petersburg, Russia.

Revision 1.0, 05/23/2012

See sysadmin-related content for all Oracle technologies by following OTN Systems on Facebook and Twitter.