0
我正在創建一個用於獲取連接的USB設備列表的Java應用程序,當我運行此操作時,出現一個名爲的錯誤屬性文件javax.usb.properties not發現,請您及時解決這個問題 這是我的java代碼:如何修復屬性文件javax.usb.properties not found
package com.example.sample;
import java.util.Iterator;
import java.util.List;
import javax.usb.*;
public class Usb
{
public static void main(String[] args) throws UsbException
{
UsbServices services = UsbHostManager.getUsbServices();
UsbHub root = services.getRootUsbHub();
listPeripherique(root);
}
private static void listPeripherique(UsbHub hub) {
List perepheriques = hub.getAttachedUsbDevices();
Iterator iterator = perepheriques.iterator();
while (iterator.hasNext()) {
UsbDevice perepherique = (UsbDevice) iterator.next();
System.out.println(perepherique);
if (perepherique.isUsbHub()) {
listPeripherique((UsbHub) perepherique);
}
}
}
}
有你閱讀:http://stackoverflow.com/questions/6913399/javax-usb-usbexception-properties-file -javax-usb-properties-not-found? – 2015-02-07 08:50:31
[Java USB library]的可能重複(http://stackoverflow.com/questions/862880/java-usb-library) – 2015-02-07 09:02:04