I have always wanted to dive into C++ world (as a rather lazy kind never did). This is my another attempt. Since FF version of Ubuntu was released few days ago, almost every day I find something new and interesting. As I’m forced to write sometimes a very small C++ application (university commitments) and a couple of months ago I have realized that Sun Studio 11 is freely available, I wanted to give it a try. Unfortunately never did, that’s because somehow I couldn’t run it under Ubuntu (sometimes you have to choose, comparing the amount of work you have to do to actually make it work or the amount of work to write the program in VIM and forget about all the gui fancy staff). Anyway FF is available and suprise, suprise, Studio 11 works almost out of the box. Here you go simple step by step guide to install this “little” precious.

1. Install Java SDK and JRE 5, for some reason SS11 doesn’t work with version 6, you can however still keep the version 6 as the default one on the system.
2. Install GNU C/C++ compiler under Ubuntu:

sudo apt-get install build-essential

3. Download Sun Studio 11 software for Linux
4. Run the installer:
change to root (su -)
move the downloaded .bz2 file to the directory where you want to install the software (in my case /opt directory)
run:
tar -xjvvf studio11-lin-x86.tar.bz2v
./installer –nodisplay
5. Answer a few simple questions about installation
6. Don’t worry if sdk 1.4 was not installed.
7. Change one of the awk scripts:
go to /installdirectory/sun/sunstudio11/prod/scripts/ver.awk
and change the line:

FS=“”| |(|)|,|t”;
to:
FS=“”| |(|)|,|t”;

8. Add the studio’s bin directory to your PATH:
Edit .bashrc and add the following line:

PATH=/opt/sun/sunstudio11/bin:$PATH; export PATH

9. Run the newly installed Studio 11 with:
sunstudio
Note:
If you have more than one JDK available and e.g version 6 is your default one, run sunstudio command with the following flag:
sunstudio=’sunstudio –jdkhome ‘path-to-your-jdk5or4′ in my case alias sunstudio=’sunstudio –jdkhome /usr/lib/jvm/java-1.5.0-sun-1.5.0.11’
If that is the case add the alias to your .bashrc file:
alias sunstudio=’sunstudio –jdkhome /usr/lib/jvm/java-1.5.0-sun-1.5.0.11′
and run the command sunstudio as normal.

Sun Studio 11 Splash Screen on Kubuntu 7.04 FF:


…and working IDE:

Good Luck 🙂