Linux on M1 Mac install java, error: Java:cannot execute binary file

Viewed 26

In the virtual machine, after I installed jdk1.8 and configured the environment variables, I tried typing "java" to make sure jdk was configured successfully. But it reported an error: "-bash: /opt/module/jdk1.8.0_212/bin/java: cannot execute binary file"

Run java

WHY???

I'm sure all the software I use is arm architecture, otherwise I wouldn't be able to start Linux. And the JDK is 64-bit.

I created my own environment variable configuration file under "profile.d". Here's what's inside that file.

#JAVA_HOME
export JAVA_HOME=/opt/module/jdk1.8.0_212
export PATH=$PATH:$JAVA_HOME/bin
PC MacBook Air M1
Virtual Machine VMware Fusion
Linux CentOS 7 ARM
JDK jdk1.8.0_212
0 Answers
Related