JNA library not found

Asked by onezeno

Java expertise: novice. I'm running the default Java setup in Ubuntu with OpenJDK 6. I am trying to compile a project on NetBeans but I am getting the error message: package com.sun.jna does not exist. I searched through Synaptic and saw that libjna-java was already installed. I reinstalled the package hoping that there was a dependency issue but that didn't work. The readme for libjna-java is:

jna
--------------

According to the current Debian policy for java [1], all jvm should
include /usr/lib/jni in their default library search path. Apparently
this is not the case; if libjnidispatch.so is not found when calling
jna, please add "-Djava.library.path=/usr/lib/jni" to your java
invocation.

 -- Yulia Novozhilova <email address hidden> Wed, 18 Jun 2008 15:44:48 +0400

[1] - http://www.debian.org/doc/packaging-manuals/java-policy/c36.html#policy-vm

---------------

The -Djava.....bit might work from a java invocation, but it is rejected by javac, and I don't know how I would make that work from an IDE anyway.
I looked in /usr/lib/jni and libjnidispatch does exist there. I tried doing a couple things like this:
export LD_LIBRARY_PATH=/usr/lib
export.............................=/urs/lib/jni
but that hasn't helped me any. Is this a common issue for Ubuntu users or do you think I've messed up my Java environment somehow? Here is my PATH if it helps:

PATH=/usr/lib/jvm/java-6-openjdk/bin:/usr/lib/jvm/java-6-openjdk/bin/client:/usr/lib/jvm/java-6-openjdk/jre/lib/bin:/usr/lib/jvm/java-6-openjdk/jre/lib/bin/client:/usr/lib/jvm/java-6-openjdk/jre/bin:/usr/lib/jvm/java-6-openjdk/jre/bin/client:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu libjna-java Edit question
Assignee:
No assignee Edit question
Solved by:
onezeno
Solved:
Last query:
Last reply:
Revision history for this message
onezeno (onezeno1) said :
#1

I tried this in a 'hello world' app:

import com.*;

and it fails too. Since my problem doesn't seem to be with libjna-java specifically, I will move my question to a Java forum.

Revision history for this message
onezeno (onezeno1) said :
#2

;