web-dev-qa-db-fra.com

Comment installer Groovy?

Quand j'essaye de lancer ceci:

Sudo apt-get install groovy 

Je reçois cette grosse erreur:

Setting up Oracle-Java7-installer (7u3-0~eugenesan~precise4) ...
Downloading...
--2012-04-28 18:43:39--  http://download.Oracle.com/otn-pub/Java/jdk/7u3-b04/jdk-7u3-linux-i586.tar.gz
Resolving download.Oracle.com (download.Oracle.com)... 96.17.181.40, 96.17.181.49
Connecting to download.Oracle.com (download.Oracle.com)|96.17.181.40|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.Oracle.com/otn-pub/Java/jdk/7u3-b04/jdk-7u3-linux-i586.tar.gz [following]
--2012-04-28 18:43:39--  https://edelivery.Oracle.com/otn-pub/Java/jdk/7u3-b04/jdk-7u3-linux-i586.tar.gz
Resolving edelivery.Oracle.com (edelivery.Oracle.com)... 184.50.22.174
Connecting to edelivery.Oracle.com (edelivery.Oracle.com)|184.50.22.174|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.Oracle.com/errors/download-fail-1505220.html [following]
--2012-04-28 18:43:40--  http://download.Oracle.com/errors/download-fail-1505220.html
Connecting to download.Oracle.com (download.Oracle.com)|96.17.181.40|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5307 (5.2K) [text/html]
Saving to: `./jdk-7u3-linux-i586.tar.gz'

     0K .....                                                 100% 47.2K=0.1s

2012-04-28 18:43:40 (47.2 KB/s) - `./jdk-7u3-linux-i586.tar.gz' saved [5307/5307]

Download done.
sha256sum mismatch jdk-7u3-linux-i586.tar.gz
Oracle JDK 7 is NOT installed.
dpkg: error processing Oracle-Java7-installer (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of groovy:
 groovy depends on default-jre-headless | Sun-Java6-jre; however:
  Package default-jre-headless is not installed.
  Package Oracle-Java7-installer which provides default-jre-headless is not configured yet.
  Package Sun-Java6-jre is not installed.
dpkg: error processing groovy (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          Errors were encountered while processing:
 Oracle-Java7-installer
 groovy
E: Sub-process /usr/bin/dpkg returned an error code (1)

J'ai déjà installé Java sur mon ordinateur. Quand je cours:

Java -version

Je reçois :

Java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot(TM) Server VM (build 23.0-b21, mixed mode)

où est-ce que je fais une erreur?

Merci d'avance.

15
Ant's

J'ai récupéré de cette erreur en faisant:

Sudo apt-get purge openjdk*

Cela vous demandera de supprimer les openjdk qui ont été installés sur votre système. Continuez avec ça. Une fois que openjdk a été supprimé de votre ordinateur, vous pouvez effectuer les opérations suivantes:

Sudo apt-add-repository ppa:groovy-dev/groovy
Sudo apt-get update
Sudo apt-get install groovy

Cela installe la version stable. Après cela, faites ceci dans votre terminal:

groovy -version

Cela devrait vous donner la sortie:

Groovy Version: 1.8.6 JVM: 1.6.0_24 Vendor: Sun Microsystems Inc. OS: Linux
25
Ant's

Au lieu de cela, j’ai simplement installé le GVM (Groovy EnVironment Manager) et l’ai utilisé pour installer Groovy.

7
ATjohnscreek