1

jsr80-1.0.1.jar と jsr80-ri.jar と jsr80-windows.jar ファイルを eclipse の参照ライブラリに追加し、commons .jar ファイルもライブラリに追加しました。コードは次のとおりです。

        UsbDevice device ;

        UsbServices services = UsbHostManager.getUsbServices();

        UsbHub rootHub = services.getRootUsbHub();
        JOptionPane.showMessageDialog(null,"3");
        device=rootHub;
          UsbConfiguration config = device.getActiveUsbConfiguration();

          List totalInterfaces = config.getUsbInterfaces();
          JOptionPane.showMessageDialog(null,"Intefaces:"+ totalInterfaces.size());
          for (int i=0; i<totalInterfaces.size(); i++)
          {
             UsbInterface interf = (UsbInterface) totalInterfaces.get(i);
             interf.claim();
             List totalEndpoints = interf.getUsbEndpoints();
             JOptionPane.showMessageDialog(null,"Endpoints:"+ totalEndpoints.size());
             for (int j=0; j<totalEndpoints.size(); j++)
             {

                UsbEndpoint ep = (UsbEndpoint) totalEndpoints.get(i);
                int direction = ep.getDirection();
                int type = ep.getType();
                final UsbPipe pipe = ep.getUsbPipe();
                JOptionPane.showMessageDialog(null, pipe.getUsbEndpoint());
                if(pipe.isActive())
                    JOptionPane.showMessageDialog(null, "pipe line active");
                pipe.open();

                        }
                      }
                    }
              // out.close();
                      }
                    };*/
                pipe.close();
             }
             interf.release();
          }

エラーメッセージが表示されます。javax.usb.usbException: java.library.path に共有ライブラリ no Libusbjni をロード中にエラーが発生しました

4

0 に答える 0