Q:

I just installed Ubuntu Restricted. How to use java?

I just installed the Ubuntu Restricted Extras. I want to code using java. How do I open the installed Extras and use java. When I type "java" in Dash home, I get many results.
Thank you. 

A:

Well the restricted extras doesn't give Oracle's JDK for some reason. (Not for me anyway) There are many tutorials on how to install java. Many are convoluted and have you use extra steps that really are not needed. But here is how I install Oracle's JDK.
First type in the terminal:
sudo apt-get purge openjdk* 

To get rid of openjdk if it is there.
Then download a nifty .rpm to .deb converter called alien
sudo apt-get install alien

Download Oracle's JRE or JDK .rpm file. 
Then run 
sudo alien jdk-7u45-linux-x64.rpm --scripts

if the .rpm name is different replace mine with the correct one. Alien will convert the .rpm to a .deb The --scripts prefix is important, do not leave it out or it will not convert the .rpm.
Run the .deb
Now you have Oracle's JDK. Don't install Eclipse from the Ubuntu Software Center. For some reason the Software Center installs OpenJDK and replaces it with the Oracle one. The update alternatives doesn't point to the directory Oracle's JDK is installed in. Your best bet to run Eclipse is to download the .zip file and unpackage it somewhere. 
The draw back is you have to run jars in the terminal. Not really a drawback from my perspective, but some people want to just double click. I find though that using the terminal actually shows what is kind of going on and it helps with finding bugs easier.

