PREVIOUS UP   Technologies Internet et Education, © TECFA
  6. Les packages et archives

6. Les packages et archives

Archives externes populaires à Tecfa

A. Installation de packages (autre que ceux de Sun)

B. Utilisation de packages dezippés

Exemple 6-1: Le package javagently dézippé

/comm/tecfa/www/guides/java/examples/gently/
tecfasun4:examples 37) ls -la gently/javagently
total 20
drwxrwxr-x   2 schneide tecfa        512 Dec  3 10:42 ./
drwxrwxr-x  18 schneide tecfa        512 Dec  3 10:36 ../
-rw-r-----   1 schneide tecfa       3506 Dec  3 10:42 Text.class
-rw-r-----   1 schneide tecfa       3975 Dec  3 10:42 Text.java
/comm/tecfa/www/guides/java/examples/gently/
javac -classpath "/comm/tecfa/www/guides/java/examples/gently/" Controller.java
   et PAS:
/comm/tecfa/www/guides/java/examples/gently/javagently
 

C. Utilisation de packages de type *.jar ou *.zip

6.1 Applications et applets avec plusieurs fichiers et archives

javac -g -d classes -classpath /local/java/classes/xml-ea2/xml.jar:/local/java/jdk1.2/lib/classes.zip project/PlayElement.java project/ProjectElement.java project/SceneElement.java project/ShowElement.java project/TitledElement.java project/GuiDemo.java
cd classes; jar cvf ../project.jar *
tecfasun4:sun-gui 236) ls -R
.:
Makefile            TECFA.README        example2.html       project.jar
Makefile.ORI        classes/            example2.html.ORI   show.props
README              example1.html       play.props
README.html         example1.html.ORI   project/
 
./classes:
project/
 
./classes/project:
GuiDemo$1.class                ProjectElement.class
GuiDemo$ErrorDialog.class      SceneElement.class
GuiDemo$ErrorPrinter.class     ShowElement$MaskedNode.class
GuiDemo$TreePanel.class        ShowElement.class
GuiDemo.class                  TitledElement.class
PlayElement.class
 
./project:
GuiDemo.java          ProjectElement.java   ShowElement.java
PlayElement.java      SceneElement.java     TitledElement.java

Exemple 6-2: Le package javagently comme *.jar file

jar cfv javagently.jar javagently
javac -classpath "/comm/tecfa/www/guides/java/examples/gently/  javagently.jar:/local/java/jdk1.1.7/lib/classes.zip" Controller.java
 

PREVIOUS UP -- TIE