Java API: okFrontPanel cannot be resolved to a type

Hi folks,

I’d like to use the JavaAPI for my Xem3005. I placed the okjFrontPanel.dll and the okjFrontPanel.jar in my \src folder from where I compile my classes.

Now here’s my problem:
Java found the com.opalkelly.frontpanel.* package, but still i cannot instatiate an opal kelly device. In fact, I can’t even use a single command from the package although it’s loaded (at least I think so).

import com.opalkelly.frontpanel.*; // works without error

public class myClass{

	static okFrontPanel xem; // Error: okFrontPanel cannot be resolved to a type 
	public static void main ( String] args ){

	    xem = new okFrontPanel(); // same thing here -.-



I use FrontPanel 3.1, JDK 1.6.0_14 and Eclipse SDK 3.5 as editor under Windows XP.
I hope someone can help me.

Are you able to compile and run the samples that are included with FrontPanel? There are instructions in the FrontPanel User’s Manual for building and running these on the command line.

I tried compiling the of yours. I get the same error.

To be honest, I don’t know anything about a Java command Line :o
But I could set a classpath to the okjFrontPanel.jar archive with a dialog within my eclipse editor, however I don’t know whether that does the trick.

Could’t you tell me how I can find this command line? (Sorry for this nooby question)

In Eclipse it is not enough to simply put the jar and the dll into the directory.

To import the JAR to your project;
Project: Properties: Java Build Path: Libraries: Add External JARs …
Then in the selection window, browse to the C:\Program Files\Opal Kelly\API\Java (or whatever it is) and find the Java JAR file and select it.

To link the DLL;
Project: Properties: Java Build Path: Source
In the source tab, expand the ‘folder’ of your project to show 3 options, click on the third, ‘Native library location’, then click the Edit button to bring up a dialogue box. Use the ‘External Folder…’ button to browse to the same area as above (C:\Program Files\Opal Kelly\API\Java) to link the dll.

Hope this makes sense …


Thank you very much, it actually does make sense!

Everything works just fine now.

@davidtyndall - Thanks for the assist. We don’t use Eclipse here (for Java anyway), so didn’t have much to input there.

@xTwStuttgart - By command line, I just meant the Windows command line. Not a specific Java one.

Following all the steps mention above for linking when using Eclipse, but when tryin to run the sample program, the results was the UnsatisfiedLinkError exception.
I was able to build the sample program sucessufuly. I linked the okjFrontPanel.jar and the okjFrontPanel.dll files from the following directory C:\Program Files\Java\jre1.6.0_04\lib. However, when trying to run it, I got the following error:
java.lang.UnsatisfiedLinkError: C:\Program Files\Java\jre6\lib\okjFrontPanel.dll: Can’t find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at DESTester.(
Exception in thread “main”

It looks like the okjFrontPanel.dll may looking for dependent libraries…

Any help with this will be greatly appricated…