0

I am using these commands to install JDK/JVM in Debian server:

apt-get install openjdk-jdk
apt-get install sun-java6-jdk

But getting lots of error:

 404 Not Found [IP: 149.20.20.6 80]
 404 Not Found [IP: 199.6.12.70 80]

I trying to install this by:

apt-cache search jdk
apt-get install sun-java6-jdk sun-java6-jre

But here also showing same problem.

Does anyone know what can be causing this problem?

Bill the Lizard
  • 352
  • 1
  • 7
  • 15
Khoyendra Pande
  • 170
  • 2
  • 11

2 Answers2

3

make sure you have run apt-get update before anything else.

The package name you likely want is openjdk-6-jdk or openjdk-6-jre (depending on if you are compiling java or just running java.

Debian is no longer distributing sun-* java packages, as oracle has changed the distribution license in a way which makes it illegal for us to do so.

If this is still not working, please show us the output of apt-cache policy openjdk-6-jre

Another possibility is that you are running a no longer supported release of Debian, like lenny (5.0) or etch (4.0), which are no longer on the regular Debian mirrors, but on http://archive.debian.org. Those would have out-dated, security-vulnerable versions of the sun java packages. However, if this is the case, I'd expect the apt-get update command to also give 404 errors. And if this is your situation, my recommendation is to first upgrade to a currently supported release of Debian.

EDIT:

You comment confirms that you are running an outdated version of debian which is no longer supported and no longer carried on the main mirrors. Lenny has been moved to the archive mirror on http://archive.debian.org/ On this archive, you will find old, known to be security-vulnerable versions of the JDKs. You could install these after changing to use the archive mirror, but my strong recommendation is to upgrade to the currently supported release by following the instructions in the chapter 4 of the squeeze release notes

stew
  • 9,388
  • 1
  • 30
  • 43
  • I am getting this by apt-cache policy openjdk-6-jre --- instead. domU-12-31-39-07-4A-8D:~# apt-cache policy openjdk-6-jre openjdk-6-jre: Installed: (none) Candidate: 6b11-9.1+lenny2 Version table: 6b11-9.1+lenny2 0 500 http://security.debian.org lenny/updates/main Packages 6b11-9.1 0 500 http://ftp.us.debian.org lenny/main Packages – Khoyendra Pande May 18 '12 at 18:36
  • I have used "apt-get update" too but error not solving. – Khoyendra Pande May 18 '12 at 18:36
  • Hadn't thought of that--it's bitten me before, too! >. – Vishal Kotcherlakota May 23 '12 at 23:13
1

Do you have network connectivity? It looks like you're having one of three problems.

  1. You don't have an internet connection. Ergo apt-get (or anything else that downloads files from the network) will not work.
  2. You're trying to download the packages from a mirror that's offline. Try checking this by using apt-get to download something else.
  3. It's possible (but unlikely) that your DNS cache is stale. Flush it using a guide like this one.

You may also be able to get the JDK in an offline form as a .deb package, and install it that way. You should be able to find what you'd need here. Once you download the .deb package, use the following command to install it:

 sudo dpkg -i packagename.deb

Where packagename.deb is the name of the package you'd like to install