java.lang.UnsatisfiedLinkError

I am developing a Processing Sketch in Eclipse that uses USB by means of the serial port emulator in jssc.jar. It charts data received over the serial port as lines on a graph. When the program is run, the sketch window opens. But in the Console tab I get these errors:

java.lang.UnsatisfiedLinkError: 'java.lang.String[] jssc.SerialNativeInterface.getSerialPortNames()'
	at jssc.SerialNativeInterface.getSerialPortNames(Native Method)
	at jssc.SerialPortList.getWindowsPortNames(SerialPortList.java:309)
	at jssc.SerialPortList.getPortNames(SerialPortList.java:298)
	at jssc.SerialPortList.getPortNames(SerialPortList.java:182)
	at processing.serial.Serial.list(Unknown Source)
	at SensorsGraph4.SensorsGraph4.setup(SensorsGraph4.java:56)
	at processing.core.PApplet.handleDraw(PApplet.java:2425)
	at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1547)
	at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:313)

What is causing these errors?

The project can be downloaded from:
http://www.mediafire.com/file/0ag0wrntteferqu/SensorsGraph4.zip/file

did you verify that your sketch works error free from the PDE?

so you know already you have a ‘eclipse IDE’ problem?

This sketch was originally developed in the PDE where it works. This problem in Eclipse is happening during my effort to migrate the sketch from PDE to Eclipse. I want to further develop the sketch in Eclipse so I can step through the execution when debugging is needed, and use either Javadoc, or Doxygen, to document it.

1 Like

thanks,
did you try

The procedure in that link is what I had already done, with the exception I imported jssc.jar, and then put it in the path. Were it not in the path I would not have been able to execute the sketch because the serial class would not be available. The errors I opened this thread with are runtime errors.

If you wish to see for yourself the workspace, and the project within it, can be downloaded from:
http://www.mediafire.com/file/0ag0wrntteferqu/SensorsGraph4.zip/file

no, i not use eclipse

but why you not take a look at
processing-3.5.3\modes\java\libraries\serial\

i would assume you just forget to copy something??


or you wait for the eclipse users to jump in here.

Try the following posts:

Kf

Your first suggest link recommends the addition of -d32 option at:
Run => Run Configurations => Java Application => => (x)= Arguments => VM Arguments
When this is done, when I run the sketch, I get message box titled “Java Virtual Machine Launcher” with the error message:

Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

In the console tab I see the error:

Unrecognized option: -d32

I do not know what to do about this. I considered installing 32 Bit Eclipse, but I do not see a 32 Bit option on the Eclipse download page.

Your second suggested link seems relevant only to Linux OS. My OS is Windows 7. I did not find a way to install “gnueabihf” in my Windows 7 OS, and if there is a Windows 7 equivalent, I do not know what it is.

The fatal exception problem is solved. To solve it:
I changed the Java installation to latest: (OpenJDK13U-jdk_x64_windows_hotspot_13.0.1_9.msi) from:

Then I downloaded the latest (version 2.8) JSSC code from:
https://search.maven.org/search?q=jssc
and in the Eclipse project I used it to substitute the JSSC that came with the Processing core.

The exception errors disappeared. But now I have the next problem. There are no serial ports returned by the Serial.list() function, even though I have an Arduino device plugged into an USB port. I would appreciate recommendations on how to troubleshoot this.

Is it possible Serial.list() is not finding USB ports because I am using the OpenJDK?

1 Like

After importing the JSSC 2.8 (the latest) I still had trouble when executing the sketch, in spite of the error indicator no longer being on that line. It turns out that the JSSC version I was using was not the problem. The problem was lack of drivers. This was solved by installing the Arduino IDE to get its USB drivers.