[JAVA] Installation de JDK sous debian

Bonsoir la zone
Pour un concours de prog’, je dois me mettre au java, mais mon gentil pc qui m’a installé jre sans broncher, me fait des histoires pour JDK (Java developper kit). Je mets le .bin dans un repertoire rien que pour lui, mais voila ce qu’il me dit:

master:/usr/jdk# ./jdk-6-nb-5_5-linux.bin

      Initializing InstallShield Wizard........

./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 404: [: : integer expression expected
./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 404: [: : integer expression expected
./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 404: [: : integer expression expected
./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 404: [: : integer expression expected
./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 1236: [: : integer expression expected
./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 1236: [: : integer expression expected
./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 1236: [: : integer expression expected
./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 1236: [: : integer expression expected
./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 382: [: : integer expression expected
./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 382: [: : integer expression expected
./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 382: [: : integer expression expected
./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 382: [: : integer expression expected

master:/usr/jdk# ls
jdk-6-nb-5_5-linux.bin

voila, je suppose qu’il me manque un truc, si quelqu’un pouvait m’aider… merci d’avance.

à tout hasard…

bc ?

allez, chuis dans un bon jour :

http://packages.debian.org/stable/bc (si c’est sur une debian)

[quote=“karith, post:1, topic: 48928”]Bonsoir la zone
Pour un concours de prog’, je dois me mettre au java, mais mon gentil pc qui m’a installé jre sans broncher, me fait des histoires pour JDK (Java developper kit). Je mets le .bin dans un repertoire rien que pour lui, mais voila ce qu’il me dit:

master:/usr/jdk# ./jdk-6-nb-5_5-linux.bin

      Initializing InstallShield Wizard........

./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 404: [: : integer expression expected
./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 404: [: : integer expression expected
./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 404: [: : integer expression expected
./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 404: [: : integer expression expected
./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 1236: [: : integer expression expected
./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 1236: [: : integer expression expected
./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 1236: [: : integer expression expected
./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 1236: [: : integer expression expected
./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 382: [: : integer expression expected
./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 382: [: : integer expression expected
./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 382: [: : integer expression expected
./jdk-6-nb-5_5-linux.bin: line 189: bc: command not found
./jdk-6-nb-5_5-linux.bin: line 382: [: : integer expression expected

master:/usr/jdk# ls
jdk-6-nb-5_5-linux.bin

voila, je suppose qu’il me manque un truc, si quelqu’un pouvait m’aider… merci d’avance.[/quote]

merci… (me sens con des fois)
Par contre, là, je dois installer un fichier .jar, comment je fais?

[quote=“karith, post:3, topic: 48928”]merci… (me sens con des fois)
Par contre, là, je dois installer un fichier .jar, comment je fais?[/quote]

Un fichier .jar ne s’installe pas. Il contient le code exécutable par la machine virtuelle, sous forme de fichiers .class compressés en une Java ARchive. Ce sont des bibliothèques de ton prof?

Normalement, tu devrais modifier ta variable d’environnement CLASSPATH pour qu’elle prenne en compte l’emplacement de ton fichier sans que tu aies à le recopier partout ou tu veux l’utiliser. (un répertoire destiné à tes packages Java serait pas du luxe, surtout si tu continues à programmer avec).

:en fait ça sort de là
http://robocode.ipl.be/

parait qu’il faut double-cliquer dessus (voir “tutorial robocode” dans le menu de gauche)

[quote=“karith, post:5, topic: 48928”]:en fait ça sort de là
http://robocode.ipl.be/

parait qu’il faut double-cliquer dessus (voir “tutorial robocode” dans le menu de gauche)[/quote]

Okay, en fait il faut que tu tapes java -jar robocode-setup.jar pour lancer l’install.

yveupaaaaaaaaaaaaas :slight_smile:

master:/usr/robocode# java -jar robocode-setup-1.6.1.4.jar
Exception in thread « main » java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit
at java.awt.Toolkit.getDefaultToolkit(libgcj.so.70)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(libgcj.so.70)
at java.awt.Window.(libgcj.so.70)
at java.awt.Frame.(libgcj.so.70)
at java.awt.Frame.(libgcj.so.70)
at javax.swing.SwingUtilities$OwnerFrame.(libgcj.so.70)
at javax.swing.SwingUtilities.getOwnerFrame(libgcj.so.70)
at javax.swing.JOptionPane.(libgcj.so.70)
at java.lang.Class.initializeClass(libgcj.so.70)
at robocode.AutoExtract.main(Unknown Source)
Caused by: java.lang.UnsatisfiedLinkError: libgtkpeer: libgtkpeer.so: Ne peut ouvrir le fichier d’objet partagé: Aucun fichier ou répertoire de ce type
at java.lang.Runtime._load(libgcj.so.70)
at java.lang.Runtime.loadLibrary(libgcj.so.70)
at java.lang.System.loadLibrary(libgcj.so.70)
at gnu.java.awt.peer.gtk.GtkToolkit.(libgcj.so.70)
at java.lang.Class.initializeClass(libgcj.so.70)
at java.lang.Class.forName(libgcj.so.70)
at java.awt.Toolkit.getDefaultToolkit(libgcj.so.70)
…9 more

Essaie de supprimer le paquet gcj-4.1-base, normalement ça devrait marcher…

il trouve plus la commande java…

Te fais pas chier : met les sources non free, apt-get update et apt-get install java-jdk-chépuquoi.

Ou change ton PATH et set la variable JAVA_HOME afin de pointer vers le répertoire bin de ton JDK et vers sa JAVA_HOME

apt-get sun-java6-jdk

:slight_smile:

Je ne sais pas si tu es à l’aise avec Linux et ses systèmes de package mais préfère toujours un bon “apt-get install” qu’une installation à la mano.

d’où mon “ajoute les sources non free”, sinon ça marchera pas.

Sinon OpenJDK n’est pas encore dispo sous debian ?

Si.

Par contre, ça me rappelle une jolie blague que m’a fait une ubuntu : javac -version renvoyait IBM … chépaquoi eclipse
Et ce truc, qui s’est installé, qu’on a l’audace d’appeler compilateur, ben il voulait pas d’un “HashSet” : HashSet is not a generic class.

je connais quand même le bon vieux apt-get, mais je savais pas que jdk y était…
(je me sens con, encore ^^)

edit: ça marche, enfin!