Awesome Open Source
Awesome Open Source


Java native bindings for libgphoto2. For details, please see This is a simple, basic library that by no means implements all of libgphoto2 features.


To build this library you will need git, the Java 7 SDK, JNA, and Apache Ant:

git clone
cd libgphoto2-jna
ant test # optional - attach camera first 

Alternatively, you can open and build the library using the Netbeans IDE or downlod a binary release.


Build and add libgphoto2-jna.jar to your project. Also ensure that libgphoto2 is installed and that is on the library path (you may need to create a symbolic link from your specific version). See the test classes and/or javadocs for details.


Simplified example showing how to take a picture:

GPhoto2 camera = new GPhoto2();;    
camera.capture();  // image remains on camera
File image = camera.captureAndDownload(); // image saved to disk

To get/set simple configuration parameters:

GPhoto2 camera = new GPhoto2();;
camera.setConfig("isoauto", "On");
String value = camera.getConfig("isoauto");

To get/set more complex configurations:

GPhoto2 camera = new GPhoto2();;
GPhoto2Config config = new GPhoto2Config(camera);
config.setParameter("burstnumber", "5");
config.setParameter("capturetarget", "Memory card");

Any parameter than can be set or read using the gphoto2 command line can be configured in this way.

Help / Support / Bugs

Please see the GitHub Issue Tracker


This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with the library. If not, see

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Java (413,161
Jna (343