I am trying to use rxtx as a way for arduino to communicate via serial port to my java program. However, despite trying many versions of rxtx downloads as well as the many answers to questions like this on stack overflow, I cannot seem to get rid of this error.
I have added to VM options the path to my librxtxSerial.jnilib file as well as RXTXcomm.jar. I have tried all of the downloads : http://rxtx.qbang.org/wiki/index.php/Download
I'd advise you to move to nrjavaserial as it is really the next (maintained) version of RXTX. The code hasn't changed significantly but they include the native libraries (which you're missing) in the Jar file so you don't have to have the Java side and the native side. I've used it for Bluetooth projects on Mac and Linux and it works well.
Related
The jawt.lib necessray to link for using of JAWT_GetAWT API.
I createded native "C" dll through this way
http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/8b04ee324a1a/test/java/awt/JAWT/myfile.cpp
My java code is
http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/8b04ee324a1a/test/java/awt/JAWT/MyCanvas.java
It is working fine in Window 7/8 64-bit OS with below code only.
For 32-bit OS, It gives below error.
java.lang.UnsatisfiedLinkError: C:\Users\Rovet.Sen\Des
ktop\POC\U\MyCanvas-32.dll: Can't find dependent libraries
It works fines in window7 32-bit os.
Now it is not working in window8 32-bit OS.
So due to the random behavior of this dll, I am try to find out the alternative for of JAWT_GetAWT API.
Is there any way to write own code for this API?
Thanks
As you don't tell which installation steps you did and where you get a problem. Find below the steps extracted from the link I already mentioned in the comment.
download the Java Access Bridge
as stated in the documentation, you don't need to for Java SE 7 Update 6 and later
install the files following the steps Installing Java Access Bridge for Windows 32-Bit
install means here
unzip the file accessbridge-2_0_2-fcs-bin-b06.zip
copy the extracted files to the given directories
run your example code
If step 3. fails, please provide us a MVCE - Minimal, Complete, and Verifiable Example
I downloaded bluecove-2.1.0.jar and added it as an external JAR on my Eclipse project. I am following this tutorial for using Bluetooth with Android: http://luugiathuy.com/2011/02/android-java-bluetooth/
When I run the program intended for my laptop to act as a server, I get an error stating 'Native library bluecove not available'. I made sure bluetooth was enabled by typing 'bluetooth' in Spotlight (which took me to Bluetooth File Exchange and allowed me to select a file to send).
I saw another Stackoverflow post stating that BlueCove requires 32-bit JVM to run so I added the -d32 argument under VM arguments in the run configuration. When I ran it, I got another error stating
"Error: This Java instance does not support a 32-bit JVM.
Please install the desired version."
Does anyone have any ideas on how to fix this?
Try using OpenJDK rather than the Oracle JDK. This supports the -d32 arguments so it ought to work for you.
OpenJDK may work as Mike suggested but its installation process was rather involved. I found a workaround by installing an earlier version of Eclipse that supported 32-bit OS X versions and setting -d32 in the VM arguments there worked without issues. Be sure to keep the earlier version of Eclipse in a separate folder so it doesn't overwrite your recent version.
I installed the 32-bit version of Eclipse Kepler from here: https://eclipse.org/downloads/packages/release/Kepler/SR2
Of course, Bluecove had some other issues with IOBluetooth device not found (since Apple removed that since OS X 10.8 I believe), for which you can check here for a possible solution.
I am trying to get GPS data from a NMEA 0183 GPS via the Java Marine API, using the RXTX API.
Running the Java Marine supplied SerialPortExample.java, I return the two errors. Perhaps they are related and so I am bundling them together into this question.
gnu.io.PortInUseException: Unknown Application
I believe this is caused by the RXTX API. A search reveals that OSX often is missing the required var/lock folder, which one would rectify by with sudo mkdir /var/lock (full details: https://groups.google.com/forum/#!topic/openhab/YUJC8DTLokc) however this does not solve my problem.
WARNING: RXTX Version mismatch
I have Jar RXTX-2.1-7 but native lib Version = RXTX-2.2pre2. I am trying to download the latest version of RXTX, but keep running into dead links (http://rxtx.qbang.org)
I am running Mavericks on MB Air.
Can anyone help?
Problem 1
gnu.io.PortInUseException: Unknown Application
I solved this by looking up the ports in use on my machine with ls /dev/tty.*
This flagged up a lot of old bluetooth devices, I cleared most of them off (Apple > System Preferences > Bluetooth) and it solved the problem
Problem 2
WARNING: RXTX Version mismatch
I took some time to delete everything associated with the RXTX install, and ensured that I was only using one version. Seems to have done the trick.
unknown port exception
This error happens while some of other programs are using the serial port .Make sure your no other applications are using serial port when your application works .check your application is also running only single copy.
RXTX version mismatch
download rxtx jar matched with your java version
I had the same bug. Make sure you terminate any other processes that could be using that connection. I was trying to run my program from the command line but the port was connected to energia's serial monitor.
RXTX: if you manually added any RXTX files delete them and run sudo apt-get install librxtx-java, this should clear up the mismatch.
I am trying to access USB ports in java, so i tried using Jusbpmp.I tried testing it in windows I got the following error.
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\T21034\Documents\NetBeansProjects\JUsbPmP\NetBeansProjects\JUsbPmP\libjpmp-0.1.1.so: Can't load this .dll (machine code=0x101) on a IA 32-bit platform.
please help me.
Thanks
The Jusbpmp project is made of two parts: a Java API and a native binary. The later needs to be built separately for every system architecture and operating system. The .so file extension distinctively marks this file as a Linux binary. As you mentioned that you are using it on a windows machine, you should try to use the jusbpmp.dll file found in the downloadable package. That one is compiled for 32 bit windows systems and so it should work for you.
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 configuration.
I found a download where I could download a javax.comm.jar file but the download included a win32comm.dll it dependented on some how - at least that was the fault I got when I added the jar file to my project.
Error loading win32com: java.lang.UnsatisfiedLinkError: no win32com in java.library.path
This is the Java Communications API. You can get it here but it won't help you. The supported platforms are Solaris SPARC, Solaris x86, and Linux x86.
For Mac and Linux, if the serial port is already configured, you can open /dev/ttyS0, /dev/ttyS1, /dev/ttyS2, etc. as a file and read/write to it. On Windows, if the serial port is already configured you can open "COM1", "COM2", etc. and read and write to it.
Unfortunately, javax.comm (as provided in the reference implementation) isn't cross-platform, so you'll have to either resort to bundling additional native libraries and supporting classes or use a platform-dependent way to configure the serial port. On Windows, this could be the "mode" command, and on Mac/Linux, this could be the stty command.
I would recommend RXTX. It doesn't use the javax.comm package, but it follows the same API (with some helpful additions).
E1: As it turns out, RXTX 2.0 does use the javax.comm package. You can find it on the same download page.