libjsane.so : The jsane cpp library for linux.

Linux libjsane.so:

  1. you need (i.e. SuSE 8.2):
    - /usr/lib/libsane.so
    - java sdk i.e. Sun's 1.4.2 which you will find by default in /usr/java/j2sdk1.4.2/
    - /usr/java/j2sdk1.4.2/include/jni.h (you need to put these in the compilers search path)
    - /usr/java/j2sdk1.4.2/include/linux/jni_md.h
    - sane.h (slightly different to <sane/sane.h>)
    - ../uk_co_mmscomputing_device_sane_jsane.h
  2. open console and cd to jsane.cpp directory
  3. compile jsane.cpp and therefore generate the library libjsane.so like this :
    g++ -Wall -fPIC -pthread -D_REENTRANT -D_GNU_SOURCE -shared -o libjsane.so jsane.cpp jdesc.cpp jnu.cpp
  4. put libjsane.so into library path of java program (4 possibilities):
    1. use -Djava.library.path=... option, when you start the program.
    2. copy libjsane.so to the java virtual machine's library folder /usr/java/j2sdk1.4.2/jre/lib/i386 (Available for all programs started with this jvm [java virtual machine])
    3. or copy libjsane.so to the operating system's library folder /usr/lib. (Available for all java programs and jvms)
    4. or use uk.co.mmscomputing.util.JarLib.load(...)

Projects :
  1. uk.co.mmscomputing.util:
    A few useful utility classes