2014-02-22 59 views
0

我正在修改this sketch以用於基於串行的熱敏打印機。正在處理:運行時出現UnsatisfiedLinkError getPortIdentifiers();

儘管聲明一個對象,一個連接功能運行時,並且特別是

Enumeration<?> portEnum = CommPortIdentifier.getPortIdentifiers();

正在產生這樣的錯誤:

java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver

這裏的連接功能的開始:

private void connect() { 


        CommPortIdentifier portId = null; 


     Enumeration<?> portEnum = CommPortIdentifier.getPortIdentifiers(); 

     // iterate through, looking for the port 
     while (portEnum.hasMoreElements()) { 
      CommPortIdentifier currPortId = (CommPortIdentifier) portEnum.nextElement(); 
      for (String portName : PORT_NAMES) { 
      if (currPortId.getName().equals(portName)) { 
       portId = currPortId; 
       break; 
      } 
      } 
     } 


     if (portId == null) { 
      System.out.println("Could not find COM port."); 
      return; 
     } 

有誰知道如何解決這個問題?我已經研究過這個錯誤消息,並且唯一出現的結果意味着一個32位問題,這似乎已經解決了許多版本的Processing之前的問題。人們提出的其他解決方案都是針對Windows和Linux平臺的。

我在運行64位處理器的Mac上。

非常感謝!

回答

0

對其進行排序。串行處理庫附帶libjSSC-2.6.jnilib,這個較舊的庫正在尋找librxtxSerial.jnilib,我抓住了here

相關問題