Software⏱️ 2 min read📅 2026-06-03

How to Fix: update-java-alternatives vs update-alternatives --config java

Learn how to fix: update-java-alternatives vs update-alternatives --config java.

Quick Answer: Try checking your system settings or restarting.

The problem lies in the fact that you are trying to update the Java alternatives configuration using two different commands: update-java-alternatives and update-alternatives --config java. These commands serve the same purpose, but they do so in slightly different ways.

🛑 Root Causes of the Error

  • The root cause of this issue is that update-alternatives --config java does not update the Java alternatives configuration correctly.

🚀 How to Resolve This Issue

Method 1: Using the Correct Command

  1. Step 1: Replace update-alternatives --config java with update-java-alternatives --config java to update the Java alternatives configuration correctly.

Method 2: Removing and Reinstalling

  1. Step 1: Remove the existing Java alternatives configuration by running update-alternatives --remove java.

Method 2 (continued)

  1. Step 1: Install the OpenJDK 6 package by running sudo apt-get install openjdk-6-jdk.

🎯 Final Words

By following one of these methods, you should be able to resolve the issue and update the Java alternatives configuration correctly.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions