
Most of them return an error code which you must check.
Read the API javadoc ( see dist/javadoc) and checkout the examples.These functions are as similar as possible to their libgphoto2 equivalents. Make sure libgphoto2 is installed and that libgphoto2.so is in your library path. Build the library (above), then add libgphoto2-jna.jar to your Java project’s classpath. The output, libgphoto2-jna.jar will be found in the “dist” directory and documentation can be found in “dist/javadoc” How to Use Make sure you have all the prerequisites installed, then run the following: git clone Gphoto2 -capture-image-and-download How to Build Sudo apt-get install libgphoto2-6 #some distros may use libgphoto2-2 instead On Debian/Ubuntu/Raspbian you can install the the prerequisites and test your setup like this: sudo apt-get install openjdk-7-jdk libjna-java git ant gphoto2 If you are a Java developer, you most likely have all these tools installed already. Java JDK with JNA support and probably some development environment like Netbeans or Eclipse. ghoto2 or at a minimum, libgphoto2.so from the gphoto2 project. Linux – gphoto2 does not run on Windows (unless you build it under Cygwin but I haven’t tested it). libgphoto2-jna uses JNA bindings generated by jnaerator which have been modified and wrapped by an easy-to-use API. Java Native Access (JNA) lets Java make calls to native shared libraries.
Part of the motivation for building this library was to work around an issue in which the gphoto2 command-line interface stops responding when running on the Raspberry Pi.
It has currently been tested on Ubuntu and Raspberry Pi and was developed as one part of a larger (proprietary) project.
It is similar to the gphoto2-java project. It allows Java applications to access cameras using the libgphoto2 library. This project is a Java API and JNA bindings for libgphoto2.