[Pkg-libvirt-commits] [libguestfs] 44/54: java: Document how to compile and run Java programs.

Hilko Bengen bengen at moszumanska.debian.org
Sun Mar 9 11:21:17 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch debian
in repository libguestfs.

commit 852cb37c9496d4cad20e539667a13c8cb48df8ae
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Sat Mar 8 12:29:00 2014 +0000

    java: Document how to compile and run Java programs.
    
    (cherry picked from commit 6fa9e5dac7c2381fc91c87152dc15c49ba38d377)
---
 java/examples/guestfs-java.pod | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/java/examples/guestfs-java.pod b/java/examples/guestfs-java.pod
index cae70ea..10deebe 100644
--- a/java/examples/guestfs-java.pod
+++ b/java/examples/guestfs-java.pod
@@ -107,6 +107,46 @@ parameters:
 
 For more information, see L<guestfs(3)/guestfs_create_flags>.
 
+=head1 COMPILING AND RUNNING
+
+Libguestfs for Java is a Java Native Interface (JNI) extension,
+supplied in three parts:
+
+=over 4
+
+=item C<libguestfs.jar>
+
+=item C<libguestfs-I<VERSION>.jar>
+
+The pure Java JAR file which contains several classes, the primary one
+being C<com.redhat.et.libguestfs.GuestFS>.  Upstream, the JAR file
+contains a version number in the filename, but some Linux distros may
+rename it without the version number.
+
+=item C<libguestfs_jni.so>
+
+The JNI code (written in C).  This contains private native functions
+that interface between Java code and the regular libguestfs C library.
+You should B<not> call these directly.
+
+=item C<libguestfs.so>
+
+The regular libguestfs C library.
+
+=back
+
+To compile your Java program, you need to locate the JAR file and add
+it to the class path.  For example:
+
+ export CLASSPATH=/usr/share/java/libguestfs.jar
+ javac MyProgram.java
+
+To run your Java program, you also need to ensure that the JAR file is
+on the class path, as well as the path of your program.  For example:
+
+ export CLASSPATH=.:/usr/share/java/libguestfs.jar
+ java MyProgram
+
 =head1 EXAMPLE 1: CREATE A DISK IMAGE
 
 @EXAMPLE1@

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list