Hello,
I have written a maven project with netbeans. When I run the program in Netbeans everything works. After building the project and running the Jar file with: java -jar filename.jar the program starts, but when I now execute one following function, I'll get a
java.lang.NoSuchMethodError:
exception. All the other functions are working.
What I have tried:
The Exception:
Extra Bytebuffer:
ByteBuffer length =217
Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer;
at humer.kamera.PhraseUvcDescriptor.phraseUvcData(PhraseUvcDescriptor.java:116)
at humer.kamera.CameraSearch.listDevice(CameraSearch.java:143)
at humer.kamera.CameraSearch.autoSearchTheCamera(CameraSearch.java:85)
at humer.kamera.Kam.AutoSearchTheCamerasActionPerformed(Kam.java:385)
at humer.kamera.Kam.access$100(Kam.java:45)
at humer.kamera.Kam$2.actionPerformed(Kam.java:281)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:842)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:886)
The Exception comes from this ByteBuffer:
public PhraseUvcDescriptor (ByteBuffer data) {
this.uvcData = ByteBuffer.allocate(data.limit());
this.uvcData = data.duplicate();
}
And when I set the Position of the ByteBuffer:
positionAbsolute += descSize;
uvcData.position(positionAbsolute);
}
I'll get the Exception:
uvcData.position(positionAbsolute);
= Line 116
I don't know, why the ByteBuffer isn't working in the Jar file, because in Netbeans everything works.
Thanks,
Peter
Project Link on GitHub:
GitHub - Peter-St/Linux_Jna_Kamera: Camera stream over Jna.[
^]