tags:

views:

36

answers:

1

I recently downloaded the Java JNA from https://jna.dev.java.net/servlets/ProjectDocumentList?folderID=7408&expandFolder=7408&folderID=0 and tried using it. However, as exemplified by the screenshot below, the demo source code provided in https://jna.dev.java.net/ won't compile, no matter where I place the files. Mind you, I've tried placing them both in the default package an every other combination of package mix-ups, and this is only the latest version. Does anybody know why the compiler can't find what is contained within the JAR file? (Also, as you can see, the class files are all in the jar file to be found) alt text

+1  A: 

Basically, the JAR should go in the classpath. In Netbeans, you can do it by adding it as library to the build path of the project through the project properties.

BalusC
I'm sure it's not NetBeans causing the issue, as I tried doing this in a completely separate location through Dr. Java.
Supuhstar
Then you likely did it wrong. Do you understand the concept "classpath"? Tell in your own words what it is.
BalusC
wouldn't that be the folder/package path in which the classes are stored?
Supuhstar
as BalusC is suggesting, right click your project, choose properties. from the popup window. choose Libraries --> Compile --> Add Jar/Folder. Then choose the jna.jar file. This will add it to the compile path. Say goodbye to your errors.
Sean
Thanks! That'll do. :3
Supuhstar