6 messages in net.java.dev.jna.usersHow to use jna.jar
FromSent OnAttachments
Jeff SadowskiAug 1, 2007 11:59 am 
Timothy WallAug 1, 2007 12:50 pm 
Jeff SadowskiAug 1, 2007 1:39 pm 
Timothy WallAug 1, 2007 3:18 pm 
Jeff SadowskiAug 1, 2007 3:28 pm 
Jeff SadowskiAug 1, 2007 4:03 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:How to use jna.jarActions...
From:Jeff Sadowski (jeff@gmail.com)
Date:Aug 1, 2007 11:59:10 am
List:net.java.dev.jna.users

Ok I downloaded jna.jar and am trying to use it, but with no success. How do I find out where to place the jna.jar file?

I just created a simple C library as follows

cat << END > hello.c char * hello() { return "hello world\n"; } END gcc -shared -o hello.so hello.c

now I want to use it in java

cat << END > hellow.java import com.sun.jna.*; import java.util.*; class hellow { public interface helloworld extends Library { char[] hello(); } public static void main(String[] args) { System.out.print(helloworld.hello()); } } END javac hellow.java hellow.java:1: package com.sun.jna does not exist import com.sun.jna.*; ^ hellow.java:5: cannot find symbol symbol : class Library location: class hellow public interface helloworld extends Library { ^ hellow.java:10: non-static method hello() cannot be referenced from a static context System.out.print(helloworld.hello()); ^ 3 errors

I have jna.jar in the same directory where I created hellow.java