无法让 java 在 arm64/v8 orange pi 5 上模拟的 amd64 docker 图像中工作

问题描述 投票:0回答:0

我正在橙色 pi 5 内的 Jenkins 测试站上工作,它将等待拉取请求以尝试通过 stm32 抽象库的一些测试。我遇到的问题是,用于 stm32 编程的 IDE 似乎不适用于基于 arm64 的架构(我觉得这很可笑,它们的全部目的是为 arm64 架构编程,但它们不适用于这些架构)

我似乎无法使用 arm64 基础架构(因为我需要编译库和测试,以便它们可以使用引导加载程序通过以太网发送到 stm32 板)我决定使用 docker 在容器中模拟 amd64 架构,在 tonistiigi/binfmt 和 ubuntu 22.04 图像的帮助下,我终于可以编译 stm32 项目,而无需在 cmake 上进行交叉编译。

我想在我的橙色 pi 5 中的 docker 容器中使用 stm32cubeIDE 模拟 amd64 ubuntu 图像,以便在其上编译 stm32 项目。

唯一的问题是 java 似乎在任何版本中都不起作用,jdk 和 jre 都不起作用(因为我只需要 java 来运行 stm32cubeIDE 和 jenkins,而不是在其上进行开发),java 11 或 8 或 17 都不起作用。我遇到的最简单、最可重复的错误是安装 java 和运行 java -version。

整个设置是这样的(在橙色 pi 5 sh ubuntu arm64/v8 环境中安装了 docker,没有图像和互联网连接):

sudo docker run --privileged --rm tonistiigi/binfmt --install amd64 sudo docker run -it -p 8080:80 --rm --platform linux/amd64 ubuntu

//现在你应该在模拟的 amd64 ubuntu 容器中。里面有:

apt-get update apt-get install default-jdk Y 

//确认您要下载它。这将安装一堆东西,其中大部分是 java 工作的依赖项。当最后安装 java 时,它会抛出三个致命错误:

Setting up default-jre-headless (2:1.11-72build2) ...
Setting up openjdk-11-jre-headless:amd64 (11.0.18+10-0ubuntu1\~22.04) ...
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/java to provide /usr/bin/java (java) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/jjs to provide /usr/bin/jjs (jjs) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/keytool to provide /usr/bin/keytool (keytool) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/rmid to provide /usr/bin/rmid (rmid) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/rmiregistry to provide /usr/bin/rmiregistry (rmiregistry) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/pack200 to provide /usr/bin/pack200 (pack200) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/unpack200 to provide /usr/bin/unpack200 (unpack200) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/lib/jexec to provide /usr/bin/jexec (jexec) in auto mode
Aborted (core dumped)

 

 A fatal error has been detected by the Java Runtime Environment:

 SIGSEGV (0xb) at pc=0x0000004002ed0229, pid=9440, tid=9443

 JRE version:  (11.0.18+10) (build )

 Java VM: OpenJDK 64-Bit Server VM (11.0.18+10-post-Ubuntu-0ubuntu122.04, interpreted mode, compressed oops, g1 gc, linux-amd64)

 Problematic frame:

 V  \[libjvm.so+0x42e229\]

 Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to //core.9440)

 An error report file with more information is saved as:

 //hs_err_pid9440.log


ignoring dump failure
Setting up ca-certificates-java (20190909ubuntu1.1) ...
head: cannot open '/etc/ssl/certs/java/cacerts' for reading: No such file or directory

 

 A fatal error has been detected by the Java Runtime Environment:

 

 SIGSEGV (0xb) at pc=0x0000004002f01229, pid=9602, tid=9605

 

 JRE version:  (11.0.18+10) (build )

 Java VM: OpenJDK 64-Bit Server VM (11.0.18+10-post-Ubuntu-0ubuntu122.04, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)

 Problematic frame:

 V  \[libjvm.so+0x42e229\]

 

 Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to //core.9602)

 

 An error report file with more information is saved as:

 //hs_err_pid9602.log

 

 

/var/lib/dpkg/info/ca-certificates-java.postinst: line 80:  9600 Done                    echo -e "-diginotar_root_ca\\n-diginotar_root_ca_pem"
9602 Aborted                 (core dumped) | java -Xmx64m -jar $JAR -storepass "$storepass"
dpkg: error processing package ca-certificates-java (--configure):
installed ca-certificates-java package post-installation script subprocess returned error exit status 134\`





Running hooks in /etc/ca-certificates/update.d... 

 A fatal error has been detected by the Java Runtime Environment:

 SIGSEGV (0xb) at pc=0x0000004002f03229, pid=11451, tid=11454

 JRE version:  (11.0.18+10) (build )

 Java VM: OpenJDK 64-Bit Server VM (11.0.18+10-post-Ubuntu-0ubuntu122.04, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)

 Problematic frame:

 V  \[libjvm.so+0x42e229\]

 Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /etc/ssl/certs/core.11451)

 
 An error report file with more information is saved as:

 /etc/ssl/certs/hs_err_pid11451.log

 

 

Aborted (core dumped)
E: /etc/ca-certificates/update.d/jks-keystore exited with code 1.
done.
Errors were encountered while processing:
ca-certificates-java
E: Sub-process /usr/bin/dpkg returned an error code (1)\`

看来证书把我搞砸了。当我尝试将 java 用于任何事情时:

\`java -version

 
 A fatal error has been detected by the Java Runtime Environment:

 

 SIGSEGV (0xb) at pc=0x0000004002ed2229, pid=11472, tid=11475

 

 JRE version:  (11.0.18+10) (build )

 Java VM: OpenJDK 64-Bit Server VM (11.0.18+10-post-Ubuntu-0ubuntu122.04, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)

 Problematic frame:

 V  \[libjvm.so+0x42e229\]

 

 Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to //core.11472)

 

 An error report file with more information is saved as:

 //hs_err_pid11472.log

 

 

Aborted (core dumped)\`

如果我使用 jdk 和 jre deb 以及通用安装程序形成 java 网页而不是使用 apt-get,也会发生同样的情况,并且它也会发生在 stm32cubeIDE jre intrinsec 版本上。

git、python3,甚至 nautilus 似乎都能完美运行,我确实在那里安装了 amd64 版本,所以它可以正确模拟,除了 java。是我搞砸了吗?是arm64/v8版本不支持tonistiigi/binfmt镜像吗?还是在java端?我无法理解这些核心转储,所以我无法理解我做错了什么。

docker ubuntu arm64 orange-pi
© www.soinside.com 2019 - 2024. All rights reserved.