I am Working on a javafx project where i am in need to generate module-info.class
file myself. So, Iam wondering how to do it properly and make it work with maven.
Iam facing this issue with a QRCode generator library zxing
. I cannot find any alternative Qr generator libraries in java with module-info.class file , if any please mention it.
I have to do this, since i use jlink which throws "automatic module cannot be used with jlink" error.
breif explanation would be very helpful :)
note: I have tried to inject the module file using a tool but it throws error: cannot read jar
I have fed up with module injector tools so ,I tried to do it with jdeps
Follow these simple step to inject the module-info properly
Copy the jar file (in my case zxing package i.e core-3.4.1.jar) into a folder (here i copied it into
libs
folder)open cmd and navigate to parent folder of libs folder .
now run the command,
It creates a module-info.java inside libs folder or inside one with its module name(in my case
com.google.zxing/module-info.java
).copy the module-info.java file and paste it inside the libs folder
Run the command,
it will generate the module-info.class file in the libs folder.
Now your module-info.class file will be injected inside the jar which you can use it in you modular javafx project
note: Don't do this unless there is no option. In my case iam using the zxing library to generate QR code and i couldn't find a good alternative for it.