Corda文档Ubuntu下JDK安装指引过时问题反馈及解决方案
Hey folks, I recently hit a roadblock following the official Corda guide for setting up Java 8 on Ubuntu. The steps use a PPA (ppa:webupd8team/java) that's no longer functional because Oracle changed their licensing back in April 2019—now you need an account to download JDKs, which broke the old package links. Here's exactly what happens when you try the original steps:
- Running
sudo add-apt-repository ppa:webupd8team/javathrows an error saying the PPA is disabled. - Trying to install with
sudo apt install oracle-java8-installerafter that gives a "no installation candidate" message, since the package source is gone.
Working Manual Installation Steps
Instead of relying on the broken PPA, here's a reliable manual installation method that works like the Windows setup process:
Grab the JDK 8 *.tar.gz package from Oracle's official downloads (note: you'll need an Oracle account to access the download).
Create a dedicated directory for your Java installation:
sudo mkdir /opt/javaExtract the downloaded tar.gz file to this directory (replace the file path with your actual download location):
sudo tar -zxf Downloads/jdk-8u221-linux-x64.tar.gz -C /opt/javaSet up environment variables by editing the system profile:
Open/etc/profilewith your favorite editor (e.g.,sudo nano /etc/profile) and add these lines at the end:export JAVA_HOME=/opt/java/jdk1.8.0_221 export PATH=$PATH:$JAVA_HOME/binDouble-check that the
JAVA_HOMEpath matches the exact folder name of your extracted JDK—yours might differ if you downloaded a newer update.Restart your Ubuntu system to apply the environment changes.
Verify everything works correctly:
First, check that your PATH includes the Java bin directory:echo $PATHYou should see
/opt/java/jdk1.8.0_221/binlisted in the output.Then confirm the Java version:
java -versionYou should get output similar to this:
java version "1.8.0_221" Java(TM) SE Runtime Environment (build 1.8.0_221-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)
This approach skips the broken PPA entirely and gives you a stable Java 8 installation that works for Corda development.
内容的提问来源于stack exchange,提问作者ChrisW

