New Ubuntu user: How do I install JAVA on Ubuntu ?

Asked by Uncle Leo

I need Java and Flasplayer to install on Ubuntu. Can somebody make this easy ?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu firefox-3.0 Edit question
Assignee:
No assignee Edit question
Solved by:
Uncle Leo
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
arochester (arochester) said :
#1

Connect to the internet, open a terminal and input: sudo apt-get install ubuntu-restricted-extras

Revision history for this message
Uncle Leo (lonink) said :
#2

When you say: Open a terminal !!! What do you mean by that ? Do I have to open a file ? Sorry I don't Linex att all !

Uncle Leo

Revision history for this message
Andy Ferguson (teknostatik) said :
#3

Go to Applications > Accessories > Terminal. You should get a $ prompt. After the $ type:

sudo apt-get install ubuntu-restricted-extras

You will then be asked for your password. Type in when prompted.

ubuntu-restricted-extras will give you java and a lot more useful things that can't be included in a base installation of Ubuntu due to licensing issues, but that a lot of people find useful.

Regards,

Andy

Revision history for this message
Uncle Leo (lonink) said :
#4

Thanks Andy Ferguson, that solved my question.

Revision history for this message
Uncle Leo (lonink) said :
#5

Everything you said I DID !!! However the application that needs JAVA still wants me to install JAVA !.

Revision history for this message
Anand (anand.arumug) said :
#6

Open a terminal and type the following:

sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk

This will install Sun Java 6 JDK, JRE and plugin.

After the installation is over, test it by entering

java --version

at the command prompt.

hope this helps.

Revision history for this message
Uncle Leo (lonink) said :
#7

leo@ubuntu:~$ sudo apt-get install sun-java6-bin sun-java-jre sun-java-jdk
E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.
leo@ubuntu:~$
Thanks ffor your patience !

Revision history for this message
Abi ^-^ (abiyasa-eka) said :
#8

open terminal, type

sudo dpkg --configure -a

and take a look at https://help.ubuntu.com/community/JavaInstallation

Thank you ^-^

Revision history for this message
peter (peter-neuweiler) said :
#9

To run Java on my system, the following files must be installed:

sun-java6-jre
sun-java6-bin
java-common
sun-java6-plugin

You can find all of them in the Synaptic Package Manager.

Hope it helps.
Peter

Revision history for this message
Anand (anand.arumug) said :
#10

Uncle Leo, can you provide more details for this reply of yours:

"Everything you said I DID !!! However the application that needs JAVA still wants me to install JAVA !"

What exactly was the message you saw on the computer? what program were you trying to run?

Revision history for this message
Uncle Leo (lonink) said :
#11

The program I need to use is from my bank in Copenhagen DK. It checks if JAVA is installed before I can login.

It is very confusing to me. To use the commandline with SUDO every time I get an other problem. I tried all the advices (Thanks), but nothing worked sofar. How do I find and open the the Synaptic -Package-manager ?

Revision history for this message
Simeon Visser (svisser) said :
#12

Synaptic can be found at System > Administration > Synaptic Package Manager. It'll ask for your password. Then click the Search button to search for the packages peter mentioned. For each of them, click at the box in front of the package and click at Mark for Installation. When you've marked them all, click Apply at the top.

Revision history for this message
Uncle Leo (lonink) said :
#13

When I open Synapt package manager i get the message: Unable to get exclusive lock.

Because it says that apt-get or apitude are running !!!!!! How can I see which applications are running AND how do I close them. Do you know if there is a book: Ubuntu for dummies ?

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#14

How to install Java

To install sun-java6

Please first enable the multiverse repository:

Open System → Administration → Software sources → [ Tab Ubuntu software ]
enable "Software restricted by copyright or legal issue ( multiverse )"
Close and confirm the repository reload.

Then open a Terminal from the menu Applications → Accessories → Terminal and type:

sudo aptitude update
sudo apt-get upgrade
sudo aptitude install sun-java6-bin sun-java6-jre sun-java6-plugin

give your user password when requested, you don't see nothing when you type it, then press enter.

Hope this helps

-----------------------------

How to install flash

Open a Terminal from the menu Applications → Accessories → Terminal and type:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

sudo apt-get install flashplugin-nonfree
sudo apt-get clean

give your user password when requested, you don't see nothing when you type it, then press enter.

If you have some trouble with sound you can also install the flashplugin-nonfree-extrasound
then open a Terminal from the menu Applications → Accessories → Terminal and type:

sudo apt-get update
sudo apt-get install flashplugin-nonfree-extrasound

Due poor integration of proprietary flash with Linux you may want to install also the mozilla plugin Flashblock
to block flash into web pages to get better Firefox and general pc performance
you may install it using mozilla here: http://flashblock.mozdev.org/installation1.html

If this solves you problem, please mark as Solved. If not, please clarify your question.

Hope this helps

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#15

Please don't run more than one package manager at the same time... if you want to play with a clear start point... the easy way is to reboot your pc.

Please use the terminal commands i get you in previous answer. (you will be able to see more detailed errors and messages)

Hope this helps

Revision history for this message
Uncle Leo (lonink) said :
#16

leo@ubuntu:~$ sudo aptitude install sun-java6-bin sun-java6-jresun-java6-plugin
[sudo] password for leo:
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?
Reading package lists... Done
Building dependency tree
Reading state information... Done
Initializing package states... Done
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?
leo@ubuntu:~$

Sorry but this is what I got !

Revision history for this message
Anand (anand.arumug) said :
#17

can you please copy paste the output of the following command:

sudo cat /var/lib/dpkg/lock

Revision history for this message
Uncle Leo (lonink) said :
#18

leo@ubuntu:~$ sudo cat/var/lib/dpkg/lock
[sudo] password for leo:
sudo: cat/var/lib/dpkg/lock: command not found
leo@ubuntu:~$

Revision history for this message
Abi ^-^ (abiyasa-eka) said :
#19

hello your commadn is wrong

It must

sudo cat /var/lib/dpkg/lock

there's must a space between cat and /var

Revision history for this message
Uncle Leo (lonink) said :
#20

leo@ubuntu:~$ sudo cat /var/lib/dpkg/lock
[sudo] password for leo:
leo@ubuntu:~$ Describe your new note here.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#21

Please be careful of spaces when you type terminal commands:

sudo <space> cat <space> /var/lib/dpkg/lock

Thank you

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#22

Oh! sorry i haven't read your previous answer

Be sure all package manager are closed.

Then try this, open a Terminal from the menu Applications → Accessories → Terminal and type:
(if the system ask you a password give your user password, you will not see nothing when you type it, then press enter)

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

if you still get the lock error please type:

sudo rm /var/lib/dpkg/lock

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

and if all works fine please read my previous answer to install Java and Flash.

Hope this helps

Revision history for this message
Anand (anand.arumug) said :
#23

Mr. Leo, in case if your problem with java installation persists, try the following:

1) reboot your Linux machine.
2) open a terminal and type the following:
3) sudo cp /var/lib/dpkg/status /var/lib/dpkg/status-w-dpkg-problem
4) sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status-old-backup
5) sudo rm /var/lib/dpkg/status
6) sudo mv /var/lib/dpkg/status-old /var/lib/dpkg/status

if you reached step-6 without any problem, then try installing java using the method described in the following link:

http://www.jaxmag.com/itr/news/psecom,id,35104,nodeid,146.html

in case if you got any of the following messages like before:

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?

try issuing the following command:

sudo rm /var/lib/dpkg/lock

and reboot the machine and go back and repeat steps 1 through 6 and install java.

Revision history for this message
Anand (anand.arumug) said :
#24

Forgot to mention in my previous message:

Steps 3 & 4 are for backing up the existing status files before deleting and renaming them. We do that just in case if anything goes wrong we can revert back to the status in which your machine was.

good luck :)

Revision history for this message
Anand (anand.arumug) said :
#25

Regarding your question on book suggestion, I think the Ubuntu guide in the following link should help you:

http://ubuntuguide.org/wiki/Main_Page

Revision history for this message
Uncle Leo (lonink) said :
#26

Thanks everybody ! I ordered Ubuntu for dummies. Because I feel lost at the moment when I am typing commands and I don't know what they mean. I will try later !!!!!