Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IllegalArgumentException: rxtx.native: Invalid module name: 'native' is not a Java identifier #157

Open
christianitis opened this issue Jan 22, 2021 · 1 comment

Comments

@christianitis
Copy link

christianitis commented Jan 22, 2021

You can probably guess what the problem is here.
I am forced to modularize my project because I am using JavaFX, but I get this error:
Error occurred during initialization of boot layer java.lang.module.FindException: Unable to derive module descriptor for /home/user/.m2/repository/org/rxtx/rxtx-native/2.2/rxtx-native-2.2-linux_x86_64.jar Caused by: java.lang.IllegalArgumentException: rxtx.native: Invalid module name: 'native' is not a Java identifier
I realize this is probably an RXTX problem, but that repo hasn't been touched in around a decade so I don't expect a fix from them.
My module-info.java has requires xbee.java.library (obviously).
Does anyone have a workaround for this? The obvious answer is to make my project non-modular, but JavaFX requires modularity so I'm kinda stuck between a rock and a hard place here. I'm on Java 11.

@msoldin
Copy link

msoldin commented Feb 4, 2022

First you need to install the libraries locally to your maven repository, because they are not in the online maven repository anymore:

mvn install:install-file -Dfile="libs/rxtx-2.2.jar" -DgroupId="org.rxtx" -DartifactId="rxtx" -Dversion="2.2" -Dpackaging="jar" -DgeneratePom="true"
mvn install:install-file -Dfile="libs/xbee-java-library-1.3.0.jar" -DgroupId="com.digi.xbee" -DartifactId="xbee-java-library" -Dversion="1.3.0" -Dpackaging="jar" -DgeneratePom="true"

On linux you also have to install the native library

apt-get install librxtx-java

Another problem for me is that the library is crashing on jdk11, it is because newer java versions only support 64 bit by default. The rxtx-library is crashing, because the default java 8 installation was 32 bit. You can install a java11 jdk from https://adoptopenjdk.net/releases.html with 32 bit to solve this problem. Another solution would be replacing the rxtx library with nrjavaserial, but this requires some work todo.

That was everything for me to get it running on my machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants