Java Comm API 安裝

來源:互聯網
上載者:User

1. 下載 Java Comm API 2.0,目前 3.0 沒有 windows 版本,不知為啥。
http://www.oreilly.com.tw/bookcode/java_io/javacomm20-win32.zip

2. Copy win32com.dll to your \bin directory.
C:\>copy c:\commapi\win32com.dll to c:\jdk1.1.6\bin

3. Copy comm.jar to your \lib directory. 
C:\>copy c:\commapi\comm.jar c:\jdk1.1.6\lib\ext 

4. Copy javax.comm.properties to your \lib directory. 
C:\>copy c:\commapi\javax.comm.properties c:\jdk1.1.6\lib

PS: The javax.comm.properties file must be installed. If it is not, no ports will be found by the system. 

5. run test program
java BlackBox

PS: Java平台的 classes 是被儲存在 Java 安裝目錄的 jre/lib/ 下的 rt.jar,另外額外的第三元件(Third- party)可以放在 /jre/lib/ext/ 中,所以 comm.jar 必需放在 ext 內,放在 lib 是找不到的。

使用 "import" 就是在告知編譯器我們的類別位於哪一個 package 下,這些類別必須設定好 CLASSPATH 才可以被編譯器找到,預設上是 jre/lib/ 下的 rt.jar、jre/lib/ext/ 中相關擴充元件與現行工作目錄。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.