Dynamically loading a native library inside Java applet

后端 未结 5 1644
孤街浪徒
孤街浪徒 2020-12-17 07:11

I am trying to write a Java applet that will read from a user\'s serial port. For this I am using the Java Comm API in conjuction with the RXTX library. I\'ve successfully m

5条回答
  •  旧巷少年郎
    2020-12-17 07:34

    I'd be real interested in the answer here also. My suggestion would be to install the .jar and .dll for RXTX into the \program files\java\ tree. You could install them on the target system before trying to use the applet. I like the idea of using Java Web Start. If you sign the applet, can't you read/write any file on the machine? So you could install the .jar and .dll and then use them afterward?

    For windows, I suggest using "Windows Java Serial Com Port Driver" rather than rxtx. You can download it from http://www.engidea.com/blog/informatica/winjcom/winjcom.html I've found it much easier to install and use and much more bug-free. I was unable to use RXTX with USB serial devices because RXTX would crash when the USB port was unplugged. winjcom solved these problems for me, and more.

    I'm still trying to decide how to deploy the DLL, but I'm not sweating it because I don't expect the DLL for "Windows Java Serial Com Port Driver" to change. -Stosh

提交回复
热议问题