0

I'm trying to install Java 1.5 on Debian.

But when I write

apt-get install java-package

in bash, the error

unable to locate package java-package

is shown. Can anybody help me?

3
  • Try running apt-get update and see if it works now Jul 25, 2011 at 14:45
  • 2
    On Ubuntu, the package is named "openjdk-6-jre" for the OpenJDK JVM.
    – João Fernandes
    Jul 25, 2011 at 14:51
  • Don't you use sudo ... for apt-get? Jul 25, 2011 at 15:34

2 Answers 2

7

That's probably because there is no java-package in Debian (where did you get that package name, BTW?)…

What you need is one of the Java Runtime Environment (JRE) packages:

This is to be able to run Java applications. If you want to develop, just install the corresponding -jdk package (e.g. sun-java6-jdk).

1

To intall Java Runtime Environment on Debian, Ubuntu, etc.

# apt-get install openjdk-7-jre

To intall package to developing programs using Java on Debian, Ubuntu, etc.

# apt-get install openjdk-7-jdk

from http://namhuy.net/1195/how-to-install-oracle-java-jdk-7.html

You must log in to answer this question.