如何添加jsr80库

时间:2013-07-10 11:57:59

标签: java eclipse

我将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中没有Libusbjni的共享库时出错

0 个答案:

没有答案