Directories in Sun Studio 12

The following are the three (major) directories used by Sun Studio 12 (also referred to as ide in this article).

  • Installation Directory. The directory where ide is installed and run from.
  • User Directory. The directory where user settings are stored. (Default: ${HOME}/.sunstudio/sunstudio.conf)
  • Projects directory. The directory where a  project is stored. Each project has its own project directory.


  • Keep the directories separate. For instance, it is possible to create the projects in user directory but not advisable. Keeping the directories separate allows you to get rid of any one of them without loosing other data. For instance, if for some reason, the ide install directory gets corrupted, then the ide can be reinstalled but the existing user settings and projects can be reused with the new install. Similarly if the userdir gets corrupted, then the ide can be run with a fresh userdir without the need to reinstall the ide and existing projects can be opened in the ide.
  • Organize your projects under one master directory. Though the ide itself does not enforce this (and correctly so), you may want to create a top-level folder for all of your projects and arrange your projects within this folder. This may be especially useful when the projects have to be maintained in a source control system.
    • Keep the sources separate from the project directory, by changing the source folders property in the project properties dialog. This way the project can always be deleted and recreated.
  • If you reinstall the ide and run into issues while running it, the most probable reason is that the older user directory has some conflicting settings; try running the ide with a different userdir, as specified in the section below.

User Directory

  • How to find the current user directory? Run the ide and open the about box (Help | About) and switch to 'Details' tab. You will notice an entry for userdir.
  • If you are unable to run the ide even: Check the [ideinstalldir]/SUNWspro/prod/etc/sunstudio.conf file. 
  • Sometimes the user directory may get corrupted resulting in strange behaviour (like settings not getting saved etc). In such cases, you can delete the user directory. The ide will recreate the directory upon next startup. The downside is all the user settings/options will be lost. All the module updates will also be lost, since updates via update center are usually put in the userdir.

The above information refers to Studio's install and user directories. Studio 12 bundles NetBeans 5.5.1 whose install directory is <studio_install_dir>/netbeans-5.5.1 and whose user directory is specified in <studio_install_dir>/netbeans-5.5.1/etc/netbeans.conf (by default ${HOME}/.netbeans/5.5.1).

It is possible to run the bundled NetBeans 5.5.1 by itself but is not recommended. One should always run Studio 12 which will run the bundled NetBeans. Since Studio and its bundled NetBeans use different directories for saving and restoting settings, running the bundled NetBeans separately will surely lead to conflicts. As a case in point, if bundled NetBeans is run and its AutoUpdate  is invoked, then modules will be dowloaded from update center and installed at NB-userdir. But Studio 12 does not use this user directory; So next time Studio 12 is run, it will not see the updates.

If there is a need to have both Studio 12 and NetBeans 5.5.1 on the same machine, then one should have a separate standalone installation of NetBeans 5.5.1.

Note: Ths article is based on a similar article written for standalone NetBeans.


sun studio -12 and netbeans are both IDE's ? Is sun studio-12
more advanced version then netbeans-6.1, because uptil now we have been using netbeans only.

Posted by shankar sharma on June 05, 2008 at 03:18 PM PDT #

Sun Studio is an ide built on top of NetBeans.
...Sun Studio software delivers high-performance, optimizing C, C++, and Fortran compilers for the Solaris OS on SPARC, and both Solaris and Linux on x86/x64 platforms, including the latest multi-core systems....

...Sun Studio vs. NetBeans C/C++
The Sun Studio IDE and NetBeans C/C++ are developed by the same team. The core functionality of the Sun Studio is based on the C/C++ plugin, so for many uses they are interchangeable.

The main differences are:

\* The C/C++ plugin strives to look and behave as close to "standard" NetBeans behavior as possible. If you know how to use netbeans for Java you shouldn't have problems using it for C/C++.
\* If you're doing JNI development you pretty much need to stick with netbeans.
\* If you're on any platform other than Solaris or Linux you need to use netbeans.
\* Sun Studio has a debugger based on dbx while NetBeans C/C++ uses the gdb debugger.
\* Sun Studio has a memory checking, a performance analyzer and a thread analyzer (new in Sun Studio 12) which have no counterparts in the C/C++ pack.
So in summary, if you're doing C and/or C++ development on Solaris or Linux, Sun Studio is probably your best choice. If you're doing mixed Java and C/C++ then netbeans. If you're not developing on Solaris or Linux then netbeans is you're only choice.

Posted by guest on June 06, 2008 at 02:46 AM PDT #

Simple question:

Can I use Netbeans 6.1 with Studio 12 on Solaris10 (AMD64) ? If yes, where can I find documentation on switching from NB5.5.1 to NB6.1 ?


Posted by Michael Thomadakis on October 22, 2008 at 03:12 AM PDT #

> Can I use Netbeans 6.1 with Studio 12 on
> Solaris10 (AMD64) ?

No. Each version of SS is built on top of a specific version of NB. (The SS modules may depend on APIs and other facilities that may not be guaranteed to be present in a future version of NetBeans). As such, the two are tightly coupled and NetBeans alone cannot be replaced.

For C/C++ of course, you should be able to use NetBeans 6.1 directly:
- You may want to check out 'Sun Studio vs. NetBeans C/C++' section in
- Downloads are available at (either c/c++ bundle or all bundle).

Posted by Karthikeyan Rajeswaran on October 22, 2008 at 03:31 AM PDT #

To add to the previous reply:

The [SS12_install_dir]//SUNWspro/bin/sunstudio scripts specifically looks for NB5.5.1 :

... Sun Studio requires a NetBeans IDE version 5.5.1
with NetBeans C/C++ Development Pack version 5.5.1
installed. Sun Studio looks for a valid NetBeans IDE
installation in the following order:
1) Location specified with --netbeanshome command
line option
2) At /opt/netbeans-5.5.1 location, if exists
3) At $SPROHOME/../netbeans-5.5.1 location, if exists
4) At $SPROHOME/../../netbeans-5.5.1 location, if
exists ...

# Validate NetBeans
function validate_netbeans
if [ -f "$1/platform6/core/core.jar" ]

platform6 directory will exist only in 5.5.1 and not in 6.1. So, SS12 is only ceritifed and expected to run on NB5.5.1.

Posted by Karthik on October 22, 2008 at 06:04 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

A blog for NetBeans users maintained by NetBeans Support team. For professional support, please check out Support Resources.


« July 2016