I can compile this JNA example code (from step 2 of https://github.com/twall/jna/#getting_started):
package com.sun.jna.examples;
import com.sun.jna.Library
This example (as well as vast majority of java classes) uses packages:
package com.sun.jna.examples;
In order to compile / run it properly you need to run javac / java from the "root" folder (e.g. folder where "com" is located):
Let's say you have a folder called examples
. You'd put both the jna.jar
and the source code in it preserving folder structure:
/examples
jna.jar
/com
/sun
/jna
/examples
HelloWorld.java
You compile and run using:
javac -classpath .:jna.jar -g com/sun/jna/examples/HelloWorld.java
java -classpath .:jna.jar com.sun.jna.examples.HelloWorld
Note the path separators in the former case and dots in the latter.