web-dev-qa-db-fra.com

comment installer Java 1.5 jdk dans Ubuntu

Je reçois cette erreur en essayant d'installer Java 1.5 jdk

Sudo apt-get install Sun-Java5-jdk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package Sun-Java5-jdk 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
However the following packages replace it:
  apt:i386 apt

E: Package 'Sun-Java5-jdk' has no installation candidate
3
Tummala Dhanvi

Télécharger JDK 5

Créer un répertoire pour JDK:

Sudo mkdir /usr/lib/jvm/Java5

Extraire l'archive dans un nouveau dossier:

Sudo tar xf Java5.tar.gz -C /usr/lib/jvm/Java5

Maintenant, lancez:

Sudo update-alternatives --install "/usr/bin/Java" "Java" "/usr/lib/jvm/Java5/jdk1.5.0/bin/Java" 1
Sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/Java5/jdk1.5.0/bin/javac" 1
Sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/Java5/jdk1.5.0/bin/javaws" 1

Corrigez la propriété du fichier et les permissions des exécutables:

Sudo chmod a+x /usr/bin/Java
Sudo chmod a+x /usr/bin/javac
Sudo chmod a+x /usr/bin/javaws
Sudo chown -R root:root /usr/lib/jvm/Java5/jdk1.5.0

Vérifiez si c'est réussi:

Java -version
7
Anton Dozortsev