tags:

views:

133

answers:

7

I just installed Ubuntu 10.4 in VMWare Workstation.

When I try to install java, I couldn't find the package:

[email protected]:~$sudo apt-get install sun-java6-jre
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 the package is missing, has been obsoleted, or
is only available from another source
E: Package sun-java6-jre has no installation candidate

I'm confused.

A: 

You could always download and install Java from the Sun / Java website.

Stephen C
A: 

Did you update your APT?

sudo apt-get update
sudo work
Yes. I tried, but still can't find the right package.
Chris
+1  A: 

It is in the multiverse repository component, I think.

I can't remember if it is enabled by dafault.

here is info to enable the multiverse for an older version, but it should be similar for 10.04.

Peter Tillemans
+6  A: 

Ubuntu is supporting OpenJDK-6 on Lucid Lynx (10.04). See the Ubuntu packages for OpenJDK for details. See also:

As someone else mentioned, the Ubuntu/Debian multiverse repositories have additional Java packages; you can enable them by following these instructions:

Craig Trader
+1, OpenJDK is not much different from Sun JDK, and it has better support in Ubuntu.
tulskiy
OpenJDK 6 *is* Sun JDK -- with a couple of libraries swapped out because of licensing issues. OpenJDK 7 will be the base for Sun JDK, not the other way around.
Craig Trader
+1  A: 

You need to enable your universe and multiverse repositories by editing /etc/apt/sources.list

It's not in the default sources list.

Steven Schlansker
+1  A: 

Do a search:

apt-cache search java

See the correct JRE name. This should work.

zengr
+2  A: 

Thanks. I solved the problem by uncommenting the following lines in /etc/apt/sources.list:

deb http://archive.canonical.com/ubuntu lucid partner
deb-src http://archive.canonical.com/ubuntu lucid partner
Chris
BTW Linux Mint, which is based on Ubuntu, has Sun JVM bundled.
01es