RXTX gnu.io.PortInUseException: & WARNING: RXTX Version mismatch - java

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.

Related

java spring boot mircoservices wont start on one pc but it will on others

I'm working on a java program made using microservices, when launching my config service I'm getting an error that me or my friends do not get on different devices.
I've tried to clean and repackage the jar file, I'm using the same version of intelij as the other pc's, and I'm using the same jdk, language level. Also I have checked if the jar files are the same size the only difference i am seeing is that on the pc i am using i'm using a slightly newer version of apache maven 3.8.1 (not working pc) instead of 3.6.1(working pc), could this be the issue or would it be something else since these things tend to be backwards compatible.
how I launch my config service: java -jar config-service/target/config-service-0.0.1-SNAPSHOT.jar --spring.profiles.active=native
link to error: https://pastebin.com/UDRxZUkh
After reinstalling my windows it worked, but I did however install my windows on my HDD instead of my m.2 SSD and after then again reinstalling windows to my m.2 SSD have been getting the same error yet again.
So I'm not sure if this is actually an issue but it seems not to want to work on the my m.2 SSD (FYI this is the m.2: Kingston NV1 NVMe PCIe SSD 1000GBM.2 2280)

How to run Android Studio on Win XP? [duplicate]

I have been trying to download Android Studio for the past week or so and haven't been able to. I'm still running windows XP on a Dell d430 (If it helps). The error happened when it was extracting a file. If you could provide a link which can download android studio for Windows XP on a Dell d430, please do. Thank you for your time (by the way I know that this question doesn't have much to do with programming).
Check this page
Wiki
Version 1.X only supported for Windows XP
The self-extraction that the installation binary performs has definitely nothing to do with what version of Studio you try to install or whether it supports XP or not, the installation shall start and tell you if there's a problem.
Actually, you can run Android Studio fine on Windows XP, I do it on a Dell Inspiron 9200 (Intel Pentium 1.7GHz 2GB RAM). I even installed the latest version 2.3.2 and Java SDK 8(which is required: make sure it's not just JRE 8 but both). Java SDK 8 complains about XP being old but installs fine. There's a snag in Studio tools with an XP dll but that can be fixed, read on.
The downloading doesn't involve extracting as your question implies, if it does you haven't got the right download. When downloading is done and the installation is started, that's when the extraction begins.
If you didn't download from developer.android.com/studio/ it might contain malware. You could scan it but being a huge file(approx. 2GB) you have to download a scanner, e.g https://www.bitdefender.com/support/how-to-install-bitdefender-on-windows-xp-and-windows-vista-1453.html
For Windows versions newer than XP / Vista refer to www.bitdefender.com/toolbox/freeapps/desktop/
After the download is done (and verified if needed), your problem with the installation program might be one or more of, but not limited to:
The file you downloaded is corrupt. Try downloading another copy.
Corruption on your hard drive, however less likely if the same file fails to extract again and again.
Your Memory or CPU is failing. Very unlikely if the same file fails even twice.
Corruption in the current directory data block or a problem with the directory path. Try creating a folder at the root with no spaces in its name ( e.g. C:\Download ), move the installation file to it and run it from there.
About support/compatibility: it's not unpermitted trying to install and run, and I for one am all for it. But if it's not supported and you run into problems, another way to go rather then upgrading your system is to downgrade your software. Here you have suggestions, but take care scanning them for malware. For smaller files(current max 128MB) you can upload to Google owned www.virustotal.com/
How to install an older version of Android Studio
Finally, the dll problem in Android Studio 2.3.2 is with the adb program requiring a newer version of WS2_32.dll (it's technical: never mind). A work around is to download an older version of adb:
forum.xda-developers.com/nexus-5x/general/psa-fix-adb-doesnt-winxp-t3403955
Or, as the suggestion here says: if you're feeling adventurous, you can always grab the new WS2_32.dll, then scan it by uploading to www.virustotal.com/, and register it with the command regsvr32 WS2_32.dll (google regsvr32 for more info on that).
coderanch.com/t/667002/Android-ADB-find-entry-point
/z
Most likely, Windows XP is not supported. You should find a way to update your operating system. Consider installing Linux on your old machine. Recent distributions will work albeit very slowly.

Getting UnsatisfiedLinkError: no rxtxSerial in java.library.path for Mac

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.

Native library bluecove not available on Mac

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.

add javax.comm API on a mac

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.

Categories

Resources