Good afternoon, everyone, I’m trying to update a Yocto layer, that was working with Java-8 and it’s required to update to Java-17.
The device that I’m trying to flash it’s an arm7 (arm on poky) and the rootfs it’s readonly, but after flash I’m getting the following errors:
The current version that I have, uses the following version of ‘meta-java’:
https://github.com/meta-java/meta-java/tree/e122acf3e9570ceb055e55feb41e5558463253e4
But I need to update to Java-17, I tried the following 2 Repos:
https://github.com/bobolopolis/meta-adoptium
This one, was able to run properly and make the installation and references, but there’s a problem when trying to run java, when I run just ‘java’ command on the image flashed on a device and run java
and java -jar
commands and I got:
Segmentation Fault
I’m pretty sure that’s something the untar process, since the error it’s being sent from java.
If I copy the tarball untar on the device and run java command, it run java without any issues.
Also tried to add on layer.conf
# Java arm configuration
PREFERRED_PROVIDER_virtual/java-initial-native = "cacao-initial-native"
PREFERRED_PROVIDER_virtual/java-initial = "cacao-initial"
PREFERRED_PROVIDER_virtual/java-native = "cacao-native"
And a custom copy process to give permissions, but still have the error:
do_install() {
install -d ${D}${JAVA_HOME}
install -d -m 0755 ${D}${JAVA_HOME}/bin
install -d -m 0755 ${D}${JAVA_HOME}/lib
install -d -m 0644 ${D}${JAVA_HOME}/conf
install -d -m 0644 ${D}${JAVA_HOME}/legal
#install -d -m ${D}${JAVA_HOME}/bin
#install -d -m ${D}${JAVA_HOME}/lib
#install -d -m ${D}${JAVA_HOME}/conf
#install -d -m ${D}${JAVA_HOME}/legal
# Copy sources to the final image
cp -r ${S}/bin/* ${D}${JAVA_HOME}/bin
cp -r ${S}/lib/* ${D}${JAVA_HOME}/lib
cp -r ${S}/conf/* ${D}${JAVA_HOME}/conf
cp -r ${S}/legal/* ${D}${JAVA_HOME}/legal
cp ${S}/NOTICE ${D}${JAVA_HOME}/NOTICE
cp ${S}/release ${D}${JAVA_HOME}/release
# Give permissions to binaries and libraries
chmod --recursive +x ${D}${JAVA_HOME}/bin
chmod --recursive +x ${D}${JAVA_HOME}/bin
chmod --recursive +x ${D}${JAVA_HOME}/lib
}
Also tried this one:
https://github.com/lucimber/meta-openjdk-temurin
But it gave me a lot of errors on the build time, and not able to generate a build, maybe it’s because it doesn’t support Dunfell.
I have another layers that do the same like .NET 8, and run without issues, and the paths are almost the same.