The language itself derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. JavaScript, a scripting language, shares a similar name and has similar syntax, but is not directly related to Java.
We have already posted about sun java was moved to the Partner repository in Ubuntu 10.04 (Lucid)
Procedure to follow
Open terminal and run the following commands
Add partner repository using the following command
sudo add-apt-repository “deb http://archive.canonical.com/ lucid partner”
Update the source list
sudo apt-get update
Now install sun java packages using the following commands
sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts
The above command will download all the required packages and begins the installation, you’ll get a screen that contains the Sun Operating System Distributor License for Java and hit Enter to continue.
You’ll see a dialog that asks you if you agree with the DLJ license terms. Select Yes, and hit Enter; the JRE will finish installing.
Testing Java Runtime Environment
You’ll want to confirm that your system is configured properly for Sun’s JRE. This is a two-step process.
First, check that the JRE is properly installed by running the following command from a terminal.
java -version
Incoming search terms:
- java ubuntu 10 04
- install java ubuntu 10 04
- ubuntu 10 04 java
- Package sun-java6-jre has no installation candidate
- ubuntu 10 04 install java
- sun-java6-jre ubuntu 10 04
- java for ubuntu 10 04
- sun java ubuntu 10 04
- sun jre ubuntu
- ubuntu 10 04 sun java





Thanks, this works! I had a little problem, but its fixed now!
[Reply]
Error: need a repository as argument
after using the first line command this error occured.any help?
[Reply]
@mesut
You must replace the double quotes with single quotes.
[Reply]
Is it just me or did your post end prematurely? I believe you were going to suggest opening Firefox and typing “about:plugins” in the browser bar to make sure that Java shows up? Thanks for the how-to. Worked great for me.
[Reply]
Tanks a million..it worked
[Reply]
… or replace the left double quote with the one on your keyboard - it got converted to the typographic version here.
[Reply]
ok so i follow those commands and this comes up: barrito@barrito-laptop:~$ sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package sun-java6-jre is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package sun-java6-jre has no installation candidate
what do i do
[Reply]
I got the exact same results as “Digital”. I am in kind of a bind as I need this kind of urgently…
[Reply]
Ok - Whit’s suggestion was what was needed. Replacing the double quotes in the add-apt-repository command with single quote marks allowed this to work.
[Reply]
Er, well, I didn’t know it required single quotes until it wasn’t working and I scrolled down. I’ve added it with single quotes now which has worked but it’s screwed my source.list.
Any idea how to fix this? >.>
[Reply]
Whit’s suggestion will probably work for me… only I have no idea how to open and edit the file D:
[Reply]
thanks man !
[Reply]
I get this message when I try to follow the prompts. Any suggestions?
ricky@ricky-laptop:~$ sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package sun-java6-jre is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package sun-java6-jre has no installation candidate
ricky@ricky-laptop:~$
[Reply]
just try the following command
sudo apt-get install sun-java6-jre sun-java6-plugin
[Reply]
@Drowzor,
To open the file i suggest you use gedit, if you are new. So go to your terminal and type:
sudo gedit /etc/apt/sources.list
Go to the bottom of the list and delete / edit the one you added. And that should fix your error
[Reply]
thank you so much!!!
[Reply]
after adding the new repo you need to update the apt database, i.e.
sudo add-apt-repository “deb http://archive.canonical.com/ lucid partner”
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts
[Reply]
all of the above makes sense and I get to the point of seeing the DLJ window listing licensing terms. however there is no selection! there is a process “whiptail” with the entire text of the DLJ. but no dialogue box appears, nor is there a place to make a selection. this is on ubuntu 10.04.1 LTS
[Reply]
further to the above, looking at the ps listing, there is no “yesno” box arg to whiptail. hmmm.
[Reply]
ok, more info - whiptail uses msgbox and there is indeed an “button” and normally one would hit and whiptail would exit and allow the calling script to continue. only it doesn’t!
whiptail ignores all keyboard, it seems, including
[Reply]
David, try to press [tab], press [enter].
[Reply]
@Trond -thanks man, worked perfectly!!!!
[Reply]
when I typed in the terminal, it appears as follows
sudo: add-apt-repositorydeb http://archive.canonical.com/ lucid partner: command not found
[Reply]
an error comes up when ever i do saying
sudo apt-get install sun-java6-jre sun-java6-plugin
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
linux-headers-2.6.32-16 linux-headers-2.6.32-16-generic
Use ‘apt-get autoremove’ to remove them.
The following extra packages will be installed:
gsfonts-x11 odbcinst odbcinst1debian1 sun-java6-bin unixodbc
Suggested packages:
sun-java6-fonts ttf-kochi-gothic ttf-sazanami-gothic ttf-kochi-mincho
ttf-sazanami-mincho ttf-arphic-uming libmyodbc odbc-postgresql tdsodbc
unixodbc-bin
The following NEW packages will be installed:
gsfonts-x11 odbcinst odbcinst1debian1 sun-java6-bin sun-java6-jre
sun-java6-plugin unixodbc
0 upgraded, 7 newly installed, 0 to remove and 6 not upgraded.
E: Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the download directory
[Reply]
@tony: make sure you don’t have a package manager open (synaptic/kpackagekit,…) or another apt-get session open in a different console
[Reply]
It work! i used a single quote. perfect, thanks man.
[Reply]
After running
sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts
I get this:
You might want to run `apt-get -f install’ to correct these:
The following packages have unmet dependencies:
sun-java6-jre: Depends: sun-java6-bin (>= 6.22-0ubuntu1~10.04) but it is not going to be installed or
ia32-sun-java6-bin (>= 6.22-0ubuntu1~10.04) but it is not installable
Recommends: gsfonts-x11 but it is not going to be installed
sun-java6-plugin: Depends: sun-java6-bin (>= 6.22-0ubuntu1~10.04) but it is not going to be installed
E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution).
I tried following the instructions by running
apt-get -f install
But then I get this
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
[Reply]
ipog@ubuntu: ~$: sudo add-apt-repository ‘deb http://archive.canonical.com/lucid partner’
i’ve problem in this line, can any one help me to reover this……….whenever i enter this line it doesn’t response simply it return back ……..to this line below
ipog@ubuntu: ~$:
[Reply]
for me to get this to work i had to do:
sudo add-apt-repository “deb http://archive.canonical.com/ubuntu lucid partner”
If you have troubles, give that a try
[Reply]
It works, thanks
here’re the lines of my sources.list file
deb http://archive.canonical.com/ubuntu lucid partner
deb http://kambing.ui.ac.id/ubuntu/ lucid main restricted universe multiverse
You’ll meet dependecy problem if only use deb http://archive.canonical.com/ubuntu lucid partner in sources.list
[Reply]