Using the Oracle Solaris Studio IDE as a Replacement for Sun Ray Client

Version 3

    by Vladimir Kvashin

     

    This article describes how to use the Oracle Solaris Studio integrated development environment (IDE) remotely and is intended as an alternate desktop solution for previous users of Sun Ray Client.

     

    Introduction

     

    The Oracle Solaris Studio IDE provides remote development functionality. Therefore, instead of using your Sun Ray Client, you can use the Oracle Solaris Studio IDE that runs on your Windows, Mac, or Linux laptop (or desktop) and have mostly the same workflow you are used to.

     

    The Oracle Solaris Studio IDE allows you to do the following:

     

    • Browse your remote server directories and edit files
    • Build and run your program on a remote server
    • Debug executable, core files or attach to a process on remote server
    • Navigate easily from build errors to source code
    • Use a remote terminal  inside the IDE window

     

    f1.gif

    Figure 1. Oracle Solaris Studio IDE

     

    It also has rich code editing, navigation, reverse engineering and refactoring capabilities, including call graphs, classes and headers hierarchy graphs, macro expansion view, code completion, and more.

     

    What Is IDE Remote Development?

     

    Remote development is an IDE feature that allows you to run the IDE itself on your Windows, Mac, or Linux laptop (or desktop) and develop (edit, build, run, debug, and analyze) code on a remote Oracle Solaris or Linux server.

     

    Source files can be shared through NFS or Samba, or (if sharing is not possible or is inefficient) the IDE can access your files directly from the remote host via the Secure File Transfer Protocol (SFTP). All the IDE needs is access via Secure Shell (SSH) to the remote host.

     

    When switching from Sun Ray Client, you will use one of the following two remote development modes: Mixed (aka Shared) or Full Remote.

     

    • In Mixed mode, the IDE accesses remote files via operating system file-sharing capabilities (NFS, Samba, and so on). If such access is possible and fast enough,   using this mode is recommended.
    • In Full Remote mode, the IDE accesses your files on a remote server via SFTP.

     

    You can find the complete description of these two remote development modes (flavors), plus a third mode that does not apply when switching from Sun Ray Client, in the "Remote Development Flavors" section below.

     

    Where to Get the IDE for Windows, Mac, or Linux

     

    It is possible to get the Oracle Solaris Studio IDE without the compilers and tools. This is called the Oracle Solaris Studio IDE Desktop Distribution. (This distribution can also contain the Oracle Solaris Studio dbxtool and Code Analyzer GUI.)

     

    To get the IDE Desktop Distribution, create a desktop distribution from the IDE running on Oracle Solaris or Linux. To do this, run the IDE on an Oracle Solaris (or Linux) machine, and choose the Tools > Options > Create Desktop Distribution menu item. This will create a .zip file that contains the IDE installation. Get this file to your laptop, unzip the archive, and call the file bin/solstusio64.exe (on Windows) or bin/solstudio (on Mac or Linux).

     

    Setting Up a Remote Development Host

     

    The first thing you usually need to do is to set up your remote host. (If you selected the Export Host Setup checkbox when creating a desktop distribution, the host on which you ran the IDE when doing that will be set up automatically when you first launch your desktop distribution.)

     

    There are two ways to set up a host:

     

    • The first is to use the Services pane. To do this, activate the Services pane by selecting Windows > Services. Then select the C/C++ Build Host node. From the context menu, select Add New Host. Then follow the wizard.
    • The second is to use the Remote toolbar. To do this, select Manage Hosts from the remote toolbar, as shown in Figure 2. A dialog box that shows a hosts list will appear. Click the Add button and follow the wizard.

      f2.gif

      Figure 2. Selecting the Manage Hosts item from the remote toolbar

       

      Note: If you do not see the remote tool bar, right-click an empty area in tool bar; then select Remote in the context menu, as shown in Figure 3:

       

      f3.gif

      Figure 3. Selecting Remote from the context menu

       

     

    If you decided to use the Full Remote mode, you can skip the rest of this section. If you are instead going to use the Shared (Mixed), remote mode, set the Access project files via field to System level file sharing in the last step of the wizard, as shown in Figure 4. That's the default setting if you run the IDE on Mac, Linux, or Oracle Solaris; but on Windows, the default is SFTP, so you need to change it if you decide to use Shared (Mixed) mode.

     

    f4.gif

    Figure 4. Setting the "Access project file via" field

     

    Opening or Creating a Remote Project

     

    This section is for those who have been already using the Oracle Solaris Studio IDE.

     

    The way you open (or create) your remote project depends on the remote mode you use.

     

    If you use the Mixed (Shared) mode (that is, you can access your source code via NFS, Samba, or another operating system–level way of file sharing), you open your project the same way you did before. Only the path to the project will be different.

     

    If you use the Full Remote mode, use either the Remote toolbar (as shown in Figure 5) or select the File > Open Remote C/C++ Project (or Create Remote C/C++ Project) menu item.

     

    f5.gif

    Figure 5. Opening or creating a remote project using the Remote toolbar

     

    The most convenient way of creating a project is creating it by binary. Choose the Create C/C++ Project by Binary item in the project wizard and point to the binary which contains debugging information. The IDE will analyze debugging information and create a project that contains exactly the files this binary was built from.

     

    Browsing Remote Server Directories

     

    To browse your remote server directories, you need to add them to the Favorites pane. To do this, activate the Services pane (via Windows > Services), expand the C/C++ Build Host node, select the host, and choose the Add to Favorites context menu item. After that, you can browse the selected file system in the Favorites pane. The Favorites pane is activated automatically as soon as you add a folder to it. To activate it manually, use the Window > Favorites menu item.

     

    Please note that once you have created an IDE project, you probably won't need this.

     

    Viewing or Editing a File

     

    There are two ways to view or edit a file:

     

    • This first way is to use the File > Open Remote File menu item.
    • The second way is to select the file in the Favorites pane and double-click it or use the Open or Edit items from the context menu.

     

    If you use projects, you can also do this via the Projects or Files pane.

     

    Debugging an Executable

     

    To debug a remote executable, you can use either of the following menu items.

     

    • When browsing a remote file system, use the context menu, as shown in Figure 6:

      f6.gif

      Figure 6. Context menu

       

    • Or use the following items in the Debug main menu:

       

      • Debug > Debug Executable
      • Debug > Attach to Process
      • Debug > Debug core files

     

    In all of the above-mentioned modes, the IDE behaves similar to dbxtool.

     

    Using a Remote Terminal

     

    The Oracle Solaris Studio IDE contains a full-fledged terminal, as shown in Figure 7:

     

    f7.gif

    Figure 7. The IDE's terminal

     

    You can open the terminal using any of the following methods:

     

    • Activate the Services pane (Window > Services), expand C/C++ Build Host, select the host, and choose the Open Terminal menu item.
    • In the Terminal pane (which you can activate via Window > IDE Tools > Terminal) click the terminal icon, and select the host you need to launch a terminal on.
    • When building a project, in the Output pane, click the terminal button, as shown in Figure 8. A terminal will be opened on the host on which the build is done in the directory in which the program is built.

      f8.gif

      Figure 8. Opening a terminal when building a project

       

     

    Using "Send To" to Add a Custom Action on Any File

     

    To run any external script or other command on a file selected in the IDE, you can use the Send To tab (select Tools > Send To in the file or folder context menu). See Figure 9. The Send To tab allows you to to add your own items. For each item, you can specify a name and the write the script to be executed when you select the item. For more information, see the IDE help.

     

    f9.gif

    Figure 9. Send To tab

     

    Remote Development Flavors

     

    The Oracle Solaris Studio IDE supports three modes (which are also called flavors) of remote development: Simple, Mixed (also known as Shared), and Full Remote.

     

    The main difference between them is where user source files are located, as shown in Figure 10:

     

    • On a remote server (Full Remote mode)
    • Somewhere at network shared location (Mixed mode)
    • On a local disk (Simple mode)

    f10.gif

    Figure 10. Three modes

     

    Use the Full Remote mode if you cannot access your code via system-level file sharing (for example, through NFS or Samba) or such sharing is too slow.

     

    Use the Mixed (Shared) mode if you can access your code from your laptop (or desktop) via NFS, Samba, and so on. With Mixed mode, you can easily switch a project to a different build server to build, run, or debug it.

     

    Simple mode copies your source code from a local machine to a remote server before building it. The IDE uses a technique to speed up this process. For example, it does not copy what was already copied from a previous build and has not been changed on the remote host. Also, it uses compression. However, if your code base is really big, copying it to a remote machine can take a while. Simple mode is convenient if your code is not very big and it resides on your local machine. It also allows you to easily switch between different hosts. With this approach, you will be able to continue working with your code when there's no server connection, for example, when you are on an airplane.

     

    Where to Ask Questions

     

    Please feel free ask any related questions on the Solaris Studio IDE, Debugging, and Analysis Tools forum.

     

    You can also use a special Forum icon in the IDE to go to the forum.

     

    See Also

     

    Oracle Solaris Studio IDE page on the Oracle Technology Network

     

    About the Author

     

    Vladimir Kvashin has been working for Sun Microsystems and Oracle since 2004. He is a principal engineer in the Oracle Solaris Studio IDE development group in St. Petersburg, Russia. Vladimir is responsible for remote development functionality.

     

      

    Revision 1.0, 03/26/2015

     

     

    Follow us:
    Blog | Facebook | Twitter | YouTube