javax.comm

CommPortIdentifier.getPortIdentifiers is empty

别说谁变了你拦得住时间么 提交于 2019-12-29 08:43:12
问题 I am building a simple application that communicates through Serial Port using the Java Communication API javax.comm. Here is some code in my java main method I wrote: CommPortIdentifier cpi = null; Enumeration e = CommPortIdentifier.getPortIdentifiers(); while (e.hasMoreElements()) { try { cpi = (CommPortIdentifier) e.nextElement(); } catch (NoSuchElementException n) { } System.out.println(cpi.getName()); } Enumeration e is always empty even though I am connected to a COM 4 port when running

Can't download javax.comm

拥有回忆 提交于 2019-12-25 14:11:58
问题 I'm making a Java ECG Software which needs to be able to communicate with an ECG through serial communication. However, the java API javax.comm is nowhere to be found. I have searched Oracle but there's no download link whatsoever. Does anyone know where I can find the API? I don't care if it's for Linux(Ubuntu) or OS X. I found an old API for windows (which is no longer supported) but it did not work on my 64 bit windows machine. 回答1: You can find it with this search : https://www.google.com

Inconsistent Results from javax.print library

本秂侑毒 提交于 2019-12-23 16:34:29
问题 I have a section of code within a Web App, running in Tomcat 5.0, that makes a call to the javax.print.PrintServiceLookup method lookupPrintServices(null, null) . Previously, this code returned an array of substantial size, listing all the printers on the server as expected. Rather suddenly one day recently, it started behaving differently, now returning a zero-size array of no printers instead. Checking rather thoroughly, I was not able to determine what might have changed to cause this

Adding comm.jar into my jar

白昼怎懂夜的黑 提交于 2019-12-22 08:01:31
问题 I add comm.jar library into my .jar and I get javax.comm.NoSuchPortException . Is this bug because I haven't add javax.comm.properties and win32com.dll into my jar? How can I add this file inside manifest? 回答1: Java does not support Jars within Jars. The correct way to ensure the javax.comm packages are on the run-time class-path of the application is to add a manifest that provides a relative path to the dependent Jar, and ensure that Jar is in the right place to be found. For details see

add javax.comm API on a mac

╄→尐↘猪︶ㄣ 提交于 2019-12-18 07:22:55
问题 I would like make an java app that communicates with a serial device(handheld scanner) so that the app is platform independent. I have found a few code examples, and when I copy them into Eclipse it says that javax.comm.* is missing. How do I install this on my Mac? And how do I add this library to my app so that the users does not have to install anything? I want to able to give the users a jar file and the device, and they should be able to run it on windows/Mac/Linux without little or none

How to read and write data to COM/Serial ports in Android?

南笙酒味 提交于 2019-12-17 22:43:51
问题 I have to read and write data to the COM ports of the device using android, I am using javax.comm package for that but when I installed the apk file, it is not displaying any ports of the device so is there any permission which I need to add in the manifest file? 回答1: Your problem is one with operating systems. Android runs Linux under the hood, and Linux treats serial ports differently than Windows does. javax.comm also contains win32com.dll , a driver file, which you won't be able to

Alternate locations for javax.comm.properties in Windows

痴心易碎 提交于 2019-12-08 14:31:54
问题 I'm building a program that needs to be installed on Windows machines for which I do not have write access to %JAVA_HOME%/lib. Is there anywhere else I can move javax.comm.properties to other than %JAVA_HOME%/lib? According to the Java COM API FAQ: Q: My application does not find any ports when it enumerates available ports. A: In order for the Java communications API to find ports the file javax.comm.properties must be in the correct place. The preferred location is in /lib. See the

Adding comm.jar into my jar

蹲街弑〆低调 提交于 2019-12-05 12:33:14
I add comm.jar library into my .jar and I get javax.comm.NoSuchPortException . Is this bug because I haven't add javax.comm.properties and win32com.dll into my jar? How can I add this file inside manifest? Java does not support Jars within Jars. The correct way to ensure the javax.comm packages are on the run-time class-path of the application is to add a manifest that provides a relative path to the dependent Jar, and ensure that Jar is in the right place to be found. For details see Working with Manifest Files: The Basics & particularly Adding Classes to the JAR File's Classpath in the Java

How to get list of available serial ports in my pc using Java?

不打扰是莪最后的温柔 提交于 2019-11-30 20:12:49
I just run some codes to get a list of available ports n my cmputer and it returned me false when I have 3 com ports that are free. How do I solve this prob? My codes: public static void main(String[] args) { //SerialParameters params=new SerialParameters(); // System.out.println(CommPortIdentifier.PORT_SERIAL ); Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println(portList.hasMoreElements()); while(portList.hasMoreElements()){ System.out.println("Has more elements"); CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType()

How to get list of available serial ports in my pc using Java?

こ雲淡風輕ζ 提交于 2019-11-30 04:36:31
问题 I just run some codes to get a list of available ports n my cmputer and it returned me false when I have 3 com ports that are free. How do I solve this prob? My codes: public static void main(String[] args) { //SerialParameters params=new SerialParameters(); // System.out.println(CommPortIdentifier.PORT_SERIAL ); Enumeration portList = CommPortIdentifier.getPortIdentifiers(); System.out.println(portList.hasMoreElements()); while(portList.hasMoreElements()){ System.out.println("Has more