digidotcom / xbee-java

Set of Java APIs to interact with Digi International's XBee radio frequency modules.
Mozilla Public License 2.0
80 stars 56 forks source link

xbee-java crashing with newer java versions #161

Open msoldin opened 2 years ago

msoldin commented 2 years ago

Why xbee-java is crashing with newer java systems like JDK11. As far as I know, this only affects 64 bit versions of Java, as the rxtx library is simply too old. I know the compatibility only says Java 8, but Java 8 is no longer supported with updates. I find it an absurdity to expose software to such security risks for customers.

What Replace the rxtx-Library with newer code libraries or write an own wrapper for it.

bramvdpol commented 2 years ago

Since there was a recent release of this library apparently development is still done on it; Please make this a priority! The only way to use the xbee-java library on recent windows version is by using an ancient JRE8 version - JRE251 from 2020 or older.

This is not acceptable for production use!

Related: https://stackoverflow.com/questions/63157940/serial-port-reading-error-exception-access-violation-c-rxtxserial-dll0x5

msoldin commented 2 years ago

@bramvdpol i totally agree on you, but as a short fix you can replace the serial library by sacrificing the unit tests. I already did that for my master thesis, seems to work fine. Still not an elegant solution, because the tests are missing.

https://github.com/msoldin/xbee-java-nrjavaserial

You could also use the 32 bit version of newer OpenJDK versions. The problem is not Java itself, only that the old serial library is only supporting 32 bit.

bramvdpol commented 2 years ago

All right, thanks for your insight! That does provide some workarounds for the time being. I think I prefer untested code that at least runs on the latest JRE compared to the current situation. I will also look into OpenJDK, that might be the best option for now. Thanks again!