Installing Sun Java

I’ve removed openJDK and need to install Sun Java, how do I do it, I’ve tried from Webupd8 http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html
But I cant get past the second command. I’ve also removed the PPA since.

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

pooky2483@pooky2483-ubuntu12:~$ sudo apt-get update
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
pooky2483@pooky2483-ubuntu12:~$

Is there an easier way?

I do not know about installing Sun Java but the update errors could be resolved.

pooky2483@pooky2483-ubuntu12:~$ sudo apt-get update E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable) E: Unable to lock directory /var/lib/apt/lists/ E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? pooky2483@pooky2483-ubuntu12:~$
It is possible that another installation is still running, in which case you must either interrupt it or wait. If that is not the case, then your lockfile is around from another installation that was interrupted.
sudo -i
rm /var/lib/apt/lists/lock
rm /var/lib/dpkg/lock
apt-get update

done that, what’s next? Try the Webupd8 java install again?

Make sure ALL package installation applications (Synaptic, Ubuntu Software centre, and Update Manager) are closed.

Now try the WebUpdate instructions again.

You can only use 1 installer at a time … and apt-get is one of them :wink:

[EDIT]

WARNING -

Be sure to DISABLE the JAVA plugin in your browser … only enable it when it’s totally NECESSARY … Oracle/Sun JAVA has MAJOR security issues, OpenJDK/Icedtea (AFAIK) doesn’t.

Thanks for the help SeZo & Mark, it installed OK just need to reboot…

See the warning above.

java -version

java version “1.7.0_15”
Java™ SE Runtime Environment (build 1.7.0_15-b03)
Java HotSpot™ 64-Bit Server VM (build 23.7-b01, mixed mode)
pooky2483@pooky2483-ubuntu12:~$

I get this warning when it wants run, the other screenshot is telling me it’s installed OK

There’s nothing wrong (as far as I can see).

IIRC, Oracle rather than fixing the security issues have opted to ask the user permission before running anything … until they can be bothered t fix it.

Don’t take this response as “gospel” … nor should you trust Oracle Java to do that every time … I’m only responding with a vague memory of reading that somewhere.