Question

I want to build libvirt java under Ubuntu 13.10, I have both OpenJDK and Oracle JDK 1.7 but I get the following error:

$ ant build
Buildfile: /home/mustafa/libvirt-java/libvirt-java-0.5.1/build.xml

init:
     [copy] Copying 1 file to /home/mustafa/libvirt-java/libvirt-java-0.5.1

build:
    [javac] Compiling 63 source files to /home/mustafa/libvirt-java/libvirt-java-0.5.1/target/classes
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.6
    [javac] /home/mustafa/libvirt-java/libvirt-java-0.5.1/src/main/java/org/libvirt/Library.java:41: error: cannot find symbol
    [javac]         Native.free(Pointer.nativeValue(ptr));
    [javac]               ^
    [javac]   symbol:   method free(long)
    [javac]   location: class Native
    [javac] 1 error
    [javac] 1 warning

I already have the jna installed,

# ll /usr/share/java/jna.jar
lrwxrwxrwx 1 root root 13 Haz  6  2011 /usr/share/java/jna.jar -> jna-3.2.7.jar

However test.sh gives the following error:

# bash test.sh 
Error: Could not find or load main class test

I tried it with both OpenJDK 1.7, Oracle 6, Oracle 7 but no luck. What is wrong? I wrote it here, (not serverfault) because it is more like a Java issue.

Was it helpful?

Solution

It seems that your JNA version does not have such method (free (long)) JNA 3.2.7 - http://grepcode.com/file/repo1.maven.org/maven2/net.java.dev.jna/jna/3.2.7/com/sun/jna/Native.java/ You could use a newer version where that method is present, such as JNA 3.3.0 - http://grepcode.com/file/repo1.maven.org/maven2/net.java.dev.jna/jna/3.3.0/com/sun/jna/Native.java/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top