0
package NClang.tinycompile;

import org.sintef.jarduino.DigitalPin;
import org.sintef.jarduino.DigitalState;
import org.sintef.jarduino.JArduino;
import org.sintef.jarduino.PinMode;
import org.sintef.jarduino.comm.Serial4JArduino;

public class Blink extends JArduino {

public Blink(String port) {
    super(port);
}

protected void setup() {
    // initialize the digital pin as an output.
    // Pin 13 has an LED connected on most Arduino boards:
    pinMode(DigitalPin.PIN_12, PinMode.OUTPUT);
}

@Override
protected void loop() {
    // set the LED on
    digitalWrite(DigitalPin.PIN_12, DigitalState.HIGH);
    delay(1000); // wait for a second
    // set the LED off
    digitalWrite(DigitalPin.PIN_12, DigitalState.LOW);
    delay(1000); // wait for a second
}

public static void main(String[] args) {
    String serialPort;
    if (args.length == 1) {
        serialPort = args[0];
    } else {
        serialPort = Serial4JArduino.selectSerialPort();

    }
    JArduino arduino = new Blink(serialPort);
    arduino.runArduinoProcess();
}
}

this is my code for blinking a LED on the Arduino Uno board, but it throws

Load RxTx
java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:123)
    at org.sintef.jarduino.comm.Serial4JArduino.getAvailableSerialPorts(Serial4JArduino.java:244)
    at org.sintef.jarduino.comm.Serial4JArduino.selectSerialPort(Serial4JArduino.java:289)
    at NClang.tinycompile.Blink.main(Blink.java:36)

I have imported the rxtxSerial library to my path, and when I try importing it again it says:

rxtxSerial already in path, no changes have been made

I have looked at some posts about this issue on this website, but they all say something like "to import rxtxSerailcomm.jar and .dll into the right directories. I followed this advice, but still got the exact same error

MWiesner
  • 8,868
  • 11
  • 36
  • 70

2 Answers2

2

You have to make sure that library (dll/so file) is added to your project. You have to look for Native library location in your settings. Take a look below.

enter image description here

You want to add your dll/so file there.

Oo.oO
  • 12,464
  • 3
  • 23
  • 45
0

You need to add the org.sintef.jarduino.core-0.1.7-SNAPSHOT.jar to your build path (right click on your project -> Build Path -> Configure Build Path -> Libraries tab)

N00b Pr0grammer
  • 4,503
  • 5
  • 32
  • 46
Hitesh sapra
  • 248
  • 2
  • 12
  • I'm so sorry to say this, but your method does not work, at least for me, it made no difference when I removed it from my build path since it was already there, but thank you for the help – Electro Squid Jan 20 '18 at 17:53