jsr-80 : installer javax.usb
Bonjour.
Je devrais utiliser javax.usb, mais je n'arrive pas à le faire fonctionner !
En effet, à la compilation du troisième build.xml (~/javax-usb-ri-linux_1.0.1/build.xml), j'ai droit à un max d'erreurs...
Je tourne sur Ubuntu Feisty, et je suis un parfait noob de Linux.
Voici une partie de ce qui s'affiche, aprés "ant all" :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| redfish@redfish:~/javax-usb-ri-linux_1.0.1$ ant all
Buildfile: build.xml
clean:
[echo] Cleaning everything.
[delete] Deleting 25 files from /home/redfish/javax-usb-ri-linux_1.0.1/src
[delete] /home/redfish/javax-usb-ri-linux_1.0.1/docs/jdoc not found.
[exec] rm -f libJavaxUsb.so JavaxUsbKernel.o JavaxUsbLog.o JavaxUsbTopologyUpdater.o JavaxUsbTopologyListener.o JavaxUsbActive.o JavaxUsbDeviceProxy.o JavaxUsbPipeRequest.o JavaxUsbInterfaceRequest.o JavaxUsbControlRequest.o JavaxUsbBulkRequest.o JavaxUsbInterruptRequest.o JavaxUsbIsochronousRequest.o JavaxUsbError.o com_ibm_jusb_os_linux_JavaxUsb.h *.o *.so
compile:
[echo] Compiling class files.
[javac] Compiling 17 source files to /home/redfish/javax-usb-ri-linux_1.0.1/src
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[echo] Compiling JNI library.
[exec] gcc -I/usr/lib/jvm/java-1.5.0-sun-1.5.0.11//include -I/usr/lib/jvm/java-1.5.0-sun-1.5.0.11//include/linux -Wall -c JavaxUsbKernel.c
[exec] Dans le fichier inclus à partir de com_ibm_jusb_os_linux_JavaxUsb.h:2,
[exec] à partir de JavaxUsb.h:14,
[exec] à partir de JavaxUsbKernel.c:11:
[exec] /usr/lib/jvm/java-1.5.0-sun-1.5.0.11//include/jni.h:21:19: erreur: stdio.h : Aucun fichier ou répertoire de ce type
[exec] In file included from com_ibm_jusb_os_linux_JavaxUsb.h:2,
[exec] from JavaxUsb.h:14,
[exec] from JavaxUsbKernel.c:11:
[exec] /usr/lib/jvm/java-1.5.0-sun-1.5.0.11//include/jni.h:1862: erreur: expected ) before * token
[exec] /usr/lib/jvm/java-1.5.0-sun-1.5.0.11//include/jni.h:1863: erreur: expected ; before void
...
...
je vous passe la quantité d'erreurs...
...
...
[exec] JavaxUsbKernel.c: In function getInterruptType:
[exec] JavaxUsbKernel.c:92: erreur: USBDEVFS_URB_TYPE_INTERRUPT undeclared (first use in this function)
[exec] JavaxUsbKernel.c:93: attention : control reaches end of non-void function
[exec] make: *** [JavaxUsbKernel.o] Erreur 1
BUILD FAILED
/home/redfish/javax-usb-ri-linux_1.0.1/build.xml:116: exec returned: 2 |
Quelqu'un le comprend ?
install javax.usb et javax.comm
le JDK 1.6 n'intègre pas de prime abord de bibliothèques de communication avec les ports USB et Série. En google-isant, je suis tombé sur 2 API supplémentaires à ajouter au JDK et permettant de tels échanges. Ces API se nomment javax-usb et RXTX. Les fichiers téléchargés contiennent tous deux des fichiers *.so ainsi que des fichiers properties et des fichiers *.jar.
Les fichiers javax.comm.properties ainsi que javax.usb.properties sont à installer dans le répertoire [jdk path]/jre/lib/ alors que les fichiers *.so sont à installer dans le répertoire [jdk path]/jre/lib/i386/. En ce qui concerne les fichiers *.jar sont à placer dans le dossier [jdk path]/jre/lib/ext/.
Il ne faudra pas oublier de rajouter les fichiers *.jar dans le CLASSPATH afin que le jdk puisse les importer.