Closed AlexanderBykin closed 5 years ago
So... if you specify -Dpicam-native then it does not try and extract the temporary library from the jar file, so that would be expected to work.
As to why the jar provider can't be found... are you using JDK modules? If so you may need to explicitly require the module that provides the jar/zip filesystem.
are you using JDK modules?
i don't think so, because it is JRE
version
i need to dig that info related to JRE Embedded
and FileSystemProvider
for jar
schema
also one thing i see, when i define -Dpicam-native
variable and program finished .so
library was deleted, can it be keeped?
Please check carefully if you are using JDK modules or not (or if you need to) because I really suspect that the required filesystem module is missing when you create your custom JDK bundle.
Regarding keeping the shared object, yes, it can be kept. Please have a look at the PicamNativeLibrary class Javadoc for methods that you can use to extract and keep the file (but it will require you to have working jar filesystem provider to extract the library in the first place).
On the other hand, if you want to use the -Dpicam-native property you can copy the shared object wherever you want and control whether it's deleted or not yourself.
@caprica
i found solution, thanks for suggestion, i think this explanation should be placed at Readme.
JVM should be server
related, changed Java Embedded
build script
./ejdk1.8.0_191/bin/jrecreate.sh \
--dest /tmp/ejdk1.8.0_191 \
--vm server \
--extension locales
Builded VM, copied to Raspberry and run test again with command
sudo java -jar ./picam-2.0.3-SNAPSHOT.jar 1280 800 test.jpg
Got it working fine!
What are the benefits of using the embedded JDK rather than the Oracle JDK?
benefits:
When run libary test
sudo java -jar ./picam-2.0.3-SNAPSHOT.jar 1280 800 test.jpg
i see error bellowAs we can see this error related to
FileSystems
and methodnewFileSystem
, not native library error.But when we run test (
.so
library is just copied from sources)sudo java -Dpicam-native=/tmp/picam-2.0.1.so -jar ./picam-2.0.3-SNAPSHOT.jar 1280 800 test.jpg
i see that test working fine and picture was taken!tested with version
2.0.2
from Maven repo and2.0.3
self compiledAs a note: As you can see i run at
Java SE Embedded
Virtual Machine created with tool from Oracle(link ARM v6/v7 Linux - VFP, HardFP ABI, Little Endian) used command