Friday, October 7, 2011

Installing Oracle Solaris Studio 12.2 on Ubuntu 11.04 64bit

Since my first encounter with Sun Studio in 2007, it is always of my intention to have Sun Studio installed on my PC. Now, I have my Dell Inspiron N4030 with its "good look" and I think it's good to spend much of my work hours with it. As Linux is the only supported operating system by Oracle Solaris Studio (Sun Studio's present name) apart from Solaris, so I decided to install the latest Ubuntu 11.04 64 bit on it. And here is what I did to get my N4030 with Ubuntu 11.04 works hand in hand with the "new Sun Studio" called Oracle Solaris Studio 12.2.

1. Download the latest JRE from here
http://www.java.com/en/download/linux_manual.jsp?locale=en
In my case I downloaded Linux x64 with size of about 20.2 MB
It's a free download! --> filename: jre-6u27-linux-x64.bin

2. Download Oracle Solaris Studio 12.2 from here
http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index.html
You need to have an account (free registration --> used to be Sun Developer Network)
It's also a free download! --> filename: SolarisStudio12.2-linux-x86-tar-ML.tar.bz2

3. Run the following command and it will extract to a directory:
username@my-ubuntu:~/Downloads$ ./jre-6u27-linux-x64.bin
username@my-ubuntu:~/Downloads$ sudo mkdir /usr/java
username@my-ubuntu:~/Downloads$ sudo cp -R jre1.6.0_27/ /usr/java/
username@my-ubuntu:~/Downloads$ gedit ~username/.bashrc &

--> add the following line at the end of .bashrc:
export PATH=$PATH:/usr/java/jre1.6.0_27/bin/:/usr/java/jre1.6.0_27/lib/:/usr/java/jre1.6.0_27/man/

--> save .bashrc, exit gedit and load the new PATH environment:
username@my-ubuntu:~/Downloads$ source ~username/.bashrc

--> check your installation:
username@my-ubuntu:~/Downloads$ java

4. Extract SolarisStudio12.2-linux-x86-tar-ML.tar.bz2 using ArchiveManager

5. Change directory to the folder created by extracting the file and run the following commands:
username@my-ubuntu:~/SolarisStudio12.2-linux-x86-tar-ML$ sudo mkdir /opt/oracle
username@my-ubuntu:~/SolarisStudio12.2-linux-x86-tar-ML$ sudo cp -R solstudio12.2/ /opt/oracle/
username@my-ubuntu:~/Downloads$ gedit ~username/.bashrc &

--> add the following line at the end of this file (.bashrc):
export PATH=$PATH:/usr/java/jre1.6.0_27/bin/:/usr/java/jre1.6.0_27/lib/:/usr/java/jre1.6.0_27/man/:/opt/oracle/solstudio12.2/bin/:/opt/oracle/solstudio12.2/lib/:/opt/oracle/solstudio12.2/man/:/opt/oracle/solstudio12.2/include/

--> save .bashrc , exit gedit and load the new PATH environment:
username@my-ubuntu:~/Downloads$ source ~username/.bashrc

--> check your installation:
username@my-ubuntu:~/Downloads$ solstudio &

I guess you're all done! In case you have problem with running the program, please check file permission. If it's a file permission problem, then run the following command:
username@my-ubuntu:~/SolarisStudio12.2-linux-x86-tar-ML$ sudo chmod 755 -R /opt/oracle/solstudio12.2/

Thank you. This works for me and my Ubuntu 11.04 64 bit and I hope it will work for you too.

Cheers!

No comments: