Ubuntu 17.10.1安装jdk-8u161-linux-arm64-vfp-hflt.tar.gz遇到问题
Hey there, let's break down what's causing your installation issues and fix it step by step.
The Core Problem
You're attempting to install the ARM64 version of JDK 8 (jdk-8u161-linux-arm64-vfp-hflt.tar.gz) on an Ubuntu 17.10.1 VM running in VMware Workstation Pro. Almost certainly, your Ubuntu VM is using the standard x86_64 (amd64) architecture—ARM64 binaries won't run on x86_64 systems, which is why your setup is failing.
Step 1: Confirm Your System Architecture
First, verify your VM's architecture to be sure. Run this command in the terminal:
uname -m
If the output is x86_64, you have an amd64 system and need the x64 version of JDK 8.
Step 2: Clean Up the Incompatible JDK Setup
Let's remove the incorrect ARM64 JDK and its alternative configurations:
- Remove the
javaalternative entry:sudo update-alternatives --remove java /usr/lib/java/jdk1.8.0_161/bin/java - Remove the
javacalternative entry:sudo update-alternatives --remove javac /usr/lib/java/jdk1.8.0_161/bin/javac - Delete the ARM64 JDK folder:
sudo rm -rf /usr/lib/java/jdk1.8.0_161
Step 3: Install the Correct x64 JDK
- Download the x64 version of JDK 8:
jdk-8u161-linux-x64.tar.gz(from the official archive you used earlier, just select the x64 package). - Extract the tar.gz file and copy the resulting
jdk1.8.0_161folder to/usr/lib/java(same directory you created before). - Reconfigure the alternatives system with the correct binaries:
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/java/jdk1.8.0_161/bin/java" 1sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/java/jdk1.8.0_161/bin/javac" 1
Step 4: Verify the Installation
Check if the setup works by running these commands:
java -version
javac -version
You should see output confirming JDK 1.8.0_161 is active.
Note: If You Need ARM64 Environment
If you actually intended to run an ARM64 system, you'll need to create an ARM-based VM in VMware Workstation Pro (note: older versions of VMware may have limited ARM support, and Ubuntu 17.10 is end-of-life—consider using a newer Ubuntu ARM release for better compatibility).
内容的提问来源于stack exchange,提问作者rattlesnake




