1

我在 Eclipse 中将 jsr80-1.0.1.jar 和 jsr80-ri.jar 和 jsr80-windows.jar 文件添加到我的引用库中,并且我还在我的库中添加了 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