Javax.comm API on 64-bit Windows - java

I am using the javax.comm API to help my program communicate with hardware over serial port. I am using the Windows 7 and NetBeans IDE 9.
I used the common Java program to check the available ports on my PC. The program compiled and ran without error. However it returned nothing.
What can I do to use the javax.comm API on Windows? It seems win32com.dll does not work with a 64-bit operating system.

This is how I got it to work.
I've tested it using JDK 1.6 (32bit) on my Windows 7 64bit machine.
Install 32bit JDK.
Copy 'win32com.dll' to JDK_HOME\jre\bin.
Copy 'javax.comm.properties'to to JDK_HOME\jre\lib.
Copy 'comm.jar'to to JDK_HOME\jre\lib\ext.
Now run your program and it should work.

Recent 2.2pre versions of RXTX include binaries for 64-bit windows. I think the latest RXTX information source has changed to this: http://rxtx.qbang.org instead of http://www.rxtx.org though.
At one point the RXTX library included drop-in support for using the javax.comm api. I'm not sure if it still does, but the main change then to use the "native" RXTX packaging was primarily just a package name change.

it seem the win32com.dll does not work with 64-bit Operating system
I think that is correct. In fact, according to the relevant download page, Oracle no longer supports the javax.comm API for any Windows platform.
However, I found this page which has a 64bit build of the DLL, among other things.
EDIT
By an astounding piece of research (i.e. following the links and reading stuff) I found the download page for the latest RXTX, which claims to have binaries for various platforms. If your platform is not there, try building from source. If that doesn't work, consider investing the effort in making it work.

I've integrated RXTX libraries into some of my earlier projects and i found out this bug it has while working with comm ports under windows, so you might want to check this first before going into some serious app design.
Communication works fine, never had any problem with that, but once you open the port you cannot close it and reopen, if you use method provided for closing port, your app just hangs, no exception no nothing. I found later the same behavior described by users on web, but never really found the solution to this problem.
Again, this might help you save some time, check it first.
Latest release, which is this http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip, doesn't have this issue no more. Unfortunately i think its solved only for windows, its still there on Linux binaries, and i haven't tried it on mac.

Have you got a look on RXTX ? I think it is still active.

I had this issue...on a 64 bit machine..running windows 7
a legacy application developed in jdk 1.4, for 32 bit windows... and using the win32 comm api binary
i tried the RXTX binary for 64 bit and i was able to communicate with my device on some level... but... there were other problems as my application referenced a version of the jpos library that internally was using the comm-api (had import javax.comm.*... in some Serial...Listener class)....
I installed a 32 bit jdk and setup the comm-api binaries for 32 bit windows as directed here...setup comm api on windows
all was fine afterwards

You might be interested at an alternative library I've authored: http://code.google.com/p/jperipheral/

Related

Run Java application on Windows Embedded Handheld 6.5

I want to run a Java Application on an Intermec scanner with Windows Embedded Handheld 6.5 Operating System. I used this tutorial.
The problem is I don't know how to run my application on the Intermec scanner.
I downloaded and installed PhoneME Advanced and PhoneME Feature from here.
I searched for JavaFX like in this tutorial, but when I follow the link to JavaFX on the Oracle site, it says it's included in the current JDK, which I can't install ("The file *** cannot be opened. Either is not signed with a trusted certificate, or one of its components cannot be found"). I tried installing the JRE but I get the same message.
Help please?
The Intermec Java installation doc is very outdated and related to IBM WEME, which is no longer be sold for a long time.
The IBM J9 licensing is strange and can only be achieved with a larger number of installations. But you may get a validation copy from microdoc.com
You may go with another JAVA VM like PhoneME or CrEme. JavaFX seems to be discontinued, whereas IBM J9 or CrEme are more or less current and supported products.
Which JVM you choose depends also on your intention. The Intermec Java Datacollection jar will only run with J9. But you can write your own JNI for the native Scanner API.

IBM Java on Linux

What would be the use case of installing IBM Java on a Linux machine? We tested our application on Linux using Oracle Java but one of ours customers installed it on a machine which only has IBM Java and the application gives errors for some missing classes and jars.
I'm assuming that the IBM java would probably have been installed because some IBM products mandate use of IBM java but this should not be a deterrent to install Oracle Java in addition to IBM java. Is my understanding correct?
Please share your thoughts.
I believe IBM doesn't ship its Java as an independent package -- so, yes, if IBM Java is present it's because an IBM product was installed that came with the IBM Java environment. (IBM supports Java on some platforms Sun doesn't; I believe the reverse is also true -- I don't think IBM bothers producing its own Java for Solaris, for obvious reasons.)
There's no problem having multiple Java's installed, each in its own directory. In some Linuxes, the alternatives mechanism can be used to select which Java is the default when you type java at the command line; in others, you would have to manually change the path or adjust symbolic links appropriately (the later is what alternatives does semi-automagically).
If you're working in Eclipse, its configuration menus will let you pick which installed copy of Java it will use to execute/debug applications, either on a workspace-default level or per launch.
(I have something like eight JREs/JDKs installed on my Red Hat machine -- a mix between Sun and IBM. Some are for my own use, for testing code for compatibility or trying to reproduce customer bug reports. Some were installed because a particular tool shipped with its own JRE rather than risk possible incompatabilities with another version; that's the only reason I still have a Java 1.5 JRE installed, for example. It's an annoyance, and it slightly belies Java's original promise of "write once, run everywhere", but it does work.)
There is nothing stopping you from having multiple installs of Java on a single linux system. However when running your application, you need to make sure that you are using the oracle version of java and not the IBM version.
which java
and
java --version
can help you find which version of java you are using.
Java is usually installed under /usr/lib/jvm or something similar to that. Checking there can help you find which java installs you have available.
You are correct that IBM java comes with IBM product installation - IBM does not ship their Java as standalone product. However, they provide provision to download their JRE for Linux from developerworks.
Ideally product running on Oracle JRE should run on IBM JRE and vice versa. However, to ensure that each product on the system runs on the JRE they are tested on, set java home properly for respective products. In case both the products use the same system-wide environment variable (which should not be the case anyway) - you may need to tweak your product settings so it does not break any IBM product running on the system.
As long as you properly isolate multiple JREs as used by different products through product/system property settings, there should not be any issue.

Definitive fool-proof steps for 0MQ / ZeroMQ and Java on Windows 7?

I've been trying to use 0MQ in my Windows dev environment with Java but I'm having a very difficult experience. It appears there are many issues with PATHs being inconsistent and the Visual Studio command prompt uses a different version of Java than the command prompt where I run my application. The inconsistencies don't stop there, and I feel like I'm not approaching this correctly.
So instead of trying to patch this process, has anyone successfully used ZeroMQ on Windows 7 64-bit and what steps and software stack did you use so that you can run a Java application locally?
Thanks for the help!
I've used zmq with F# on Win7/64bit; it's very easy to make it work there.
As for the Java side of things, I found this documentation: http://www.zeromq.org/bindings:java
and
https://github.com/zeromq/jzmq which is the official binding.

Can't download javax.comm

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.
You can find it with this search : https://www.google.com/search?q=%22comm.jar%22+Index+of
However it's probably the same old version you already have.
It's been a while since I worked with it (for a credit card scanner/signature pad). I remember using rxtx, though I don't remember if I also used an oracle download. I believe the rxtx implementation was sufficient. Just be aware that mixing 32 bit linux libs with 64 bit linux jvms is a no-no. At a minimum, you'd need a recompile or the linking/loading process of the lib will fail.
http://rxtx.qbang.org/wiki/index.php/Main_Page

Eclipse for Mac OS X

I am Java developer who is using Eclipse on a X86 computer to code. I am considering to buy for other reasons an Desktop Mac computer and I would like to use this computer to do my coding work. I know there is a Eclipse version for Macs, I am asking if there may be some problems/issues related to Macintosh computers. Thanks!
It really depends what you'll be doing.
In terms of the IDE, it will work just fine and you can copy your files/projects over and they will "just work".
However, there are some things you need to be weary of:
Key mappings might be different
You won't be able to do any JavaME programming as there is no Mac toolkit for that.
If you're doing Swing development, make sure you test your code on your target environment as things might look different.
Other than that, Macs work fantastic for Java coding.
No, Eclipse works just as well on a Mac as on a Windows or Linux computer. Key bindings are different though; if you're used to the shortcut keys of Eclipse on Windows, you'll need to get used to different shortcuts on the Mac.
Apple just announced that they are deprecating their Java platform. That may cause some problems in the future. Update: however, I have seen that Eclipse works with the soylatte OpenJDK port.
http://developer.apple.com/tools/eclipse.html
and if you want the non-Apple-bs experience:
http://cdtdoug.blogspot.com/2010/04/mac-gets-no-love.html
From my personal experience, Eclipse actually works better on OS X and Linux than it does on Windows. I'm a professional plugins developer and I do all my coding on Mac. I blog about Eclipse and Mac related topics, so I invite to read it.
Adding to the limitations mentioned in other answers, if you have specific plugins that you need, not all support Macs, although most. For example, The Eclipse TPTP (short for profiler) project doesn’t profile on Mac. There are alternatives in most cases, though (AFAIK, not free in the case of TPTP).
Personal experience for RCP-development: 2G of RAM are not enough (at least not for our project), so the current MacBook Airs are not suitable at all for development. But then, you're talking about desktop Macs anyway, so if you can get the >2G, it should be fine.
During the 64bit transition phase, there were some glitches with missing 64bit Cocoa, but that has been resolved. Some of the extensions may be platform specific: currently, TPTP (Test and Performance Tools Platform Project) still has some limitation.
eclipse for mac works exactly as you know it from your pc. the only thing that differs is the arrangement of some keys (the # is on L, the arrangement of the braces differs a bit)
Eclipse works fine, but with different keybindings.
I have found that sharing files with other computers - e.g. through a source repository - may give you character set conversion issues. If you stay with pure ASCII in your source you should not have any problems.
You can download Eclipse 3.6.1 from eclipse.org directly (where your platform is autodetected) or from http://download.eclipse.org/eclipse/downloads/drops/R-3.6.1-201009090800/index.php#EclipseSDK
I would suggest getting the Java EE version from the frontpage. It contains web stuff I use regularily.

Categories

Resources