почему метод RXTXCommDriver.nativeGetVersion () не работает - PullRequest
1 голос
/ 07 июня 2019

Я работаю с библиотекой JPOS.Я пытаюсь получить список всех com-портов, используя класс RXTXCommDriver.Ошибка возникает при вызове основного собственного метода, который получает список всех портов.

java.lang.UnsatisfiedLinkError: javax.comm.RXTXCommDriver.nativeGetVersion () Ljava / lang / String;

public class RXTXCommDriver implements CommDriver
{

    private final static boolean debug = true;
    private final static boolean devel = false;
    private final static boolean noVersionOutput = "true".equals( System.getProperty( "gnu.io.rxtx.NoVersionOutput" ) );

    static
    {
        if(debug ) System.out.println("RXTXCommDriver {}");
        System.loadLibrary( "rxtxSerial" );

        /*
           Perform a crude check to make sure people don't mix
           versions of the Jar and native lib

           Mixing the libs can create a nightmare.

           It could be possible to move this over to RXTXVersion
           but All we want to do is warn people when first loading
           the Library.
        */
        String JarVersion = RXTXVersion.getVersion();
        String LibVersion;
        try {
                LibVersion = RXTXVersion.nativeGetVersion();
        } catch ( Error UnsatisfiedLinkError )
        {
            // for rxtx prior to 2.1.7
            LibVersion = nativeGetVersion();
        }
        if ( devel )
        {
            if ( ! noVersionOutput )
            {
                System.out.println("Stable Library");
                System.out.println("=========================================");
                System.out.println("Native lib Version = " + LibVersion );
                System.out.println("Java lib Version   = " + JarVersion );
            }
        }
...