Minecraft with OpenJDK 7, I get "the trustAnchors parameter must be non-empty"

99

Solution 1

I just solved it! Here is how to fix all SSL errors in Minecraft.

  1. You need another Linux computer's "cacerts" file, so on another Linux PC run this command:

    readlink -f /usr/bin/java | sed "s:bin/java::"
    

    and go to that path (Something like /usr/lib/jvm/java-8-openjdk-amd64/jre/).

  2. Open the "lib" folder, then open the "security" folder.
  3. Copy the "cacerts" file.
  4. Run the command again on your computer and go to that path:

    readlink -f /usr/bin/java | sed "s:bin/java::"
    
    • If you are having trouble editing things, you need to open "Files" using sudo -H nautilus.
  5. Open "lib" and then "security" again.
  6. Replace the "cacerts" file with the file from the other PC.

If you can't find the "cacerts" file on another PC, check this path for it /etc/ssl/certs/java/ and you should see cacerts. I can't guarantee this working though.

Solution 2

Actually, a better answer is to enter the following at the command prompt.

sudo update-ca-certificates -f

Solution 3

Open a terminal and fire this command:

sudo apt-get install --reinstall ca-certificates-java

And make sure that the time setting of your system is correct.

Source

I quote:

Basically, Minecraft uses SSL to protect your login, but Java didn’t have the certificates needed to verify. The Minecraft launcher really should give a better error message, but this was really Ubuntu’s fault. You need the ca-certificates-java package installed, but on my Ubuntu install, it was broken. Try doing ls /etc/ssl/certs/java/cacerts. If it comes up missing, then you need copy it from a friend or a different Unix machine. You don’t want to copy security files from strangers…

Solution 4

I finally found a solution after none of the others worked for me. At the bottom of this bug report, I found this magical series of commands:

sudo dpkg --purge --force-depends ca-certificates-java

And then:

sudo apt-get install ca-certificates-java

This instantly solved the problem for me.

Share:
99

Related videos on Youtube

TechCode
Author by

TechCode

Updated on September 18, 2022

Comments

  • TechCode
    TechCode over 1 year

    I have created a todo-apps with js but I have a problem : when I am clicking on the check button to do someting or on the edit button or the time button all tasks are changed : for example when I click on the check button on « learn js » I want that just this task changed ( underline) but when I do that all my tasks become underline. I know this is a beginner question sorry. This is my HTML code :

    <h1>To Do List</h1>
    <input type="text" placeholder="Name..." id="Name">
    <input type="button" id="addItem" value="Add Item" />
       <div class="choices">
         <p id="p"></p>
        </div>
      <button id="btn" type="submit"> Clear Items</button>
    

    This is my JS code :

    let clear  =  document.getElementById("btn");
    let add = document.getElementById("addItem");
    let choices = [];
    let vide = document.getElementById('p');
    var choice = document.getElementById("Name").value;
    let invalid = document.getElementById("invalid");
    
    function main() {
    add.addEventListener('click', function() {
    addItems();
    })
    }
    
    function addItems() {
       choice = document.getElementById("Name").value;
    
        vide.innerHTML += choice;
       choices.push(choice);
       document.getElementById('p').insertAdjacentHTML('beforeend', `<i id="check" class="far fa-check-circle"></i>`);
       document.getElementById('p').insertAdjacentHTML( 'beforeend', `<i id="null" class="far fa-times-circle"></i>`);
      document.getElementById('p').insertAdjacentHTML( 'beforeend', `<i.     id="edit" class="far fa-edit"></i>`);
      vide.insertAdjacentHTML('beforeend', `<br/><br/>`);
       document.getElementById('p').classList.add('listClass');
    
       document.getElementById('check').onclick = function() {
      document.getElementById('p').classList.toggle("done");
                document.getElementById('check').classList.toggle('opacity');
        };
        document.querySelector('#null').onclick = function() {
          vide.innerHTML ='';
        };
    document.getElementById('edit').onclick = function() {
      // I have not finished this part
     }
     }
     }
    
    main();
    

    This is a picture of the result : picture

    • Niet the Dark Absol
      Niet the Dark Absol almost 4 years
      HTML IDs must be unique. You keep adding <i id="check" ... and similar several times, resulting in duplicate IDs, and that is causing problems.
    • TechCode
      TechCode almost 4 years
      @NiettheDarkAbsol How to resolve this ????
  • ashermaster
    ashermaster almost 9 years
    Same error message after trying this, is my "Time Setting" just the system time because that is right. Also doing ls /etc/ssl/certs/java/cacerts isnt missing
  • Lessneek
    Lessneek over 8 years
    thx, it helped me too =)
  • Christian
    Christian over 8 years
    this also helped to fix my maven setup on 15.10
  • Philip
    Philip almost 8 years
    That was the fix for me as well... Been searching for a minute. Thanks!
  • mgrandi
    mgrandi almost 8 years
    This helped me as well, I installed OpenJDK8 on ubuntu server (wily) and was trying to run a java application that uses OAuth for twitter, and was getting this error , and was very confused since ca-certificates-java was installed already. After running this, everything worked fine!
  • Clay Ferguson
    Clay Ferguson over 7 years
    I can also confirm this worked for me also. I was getting this error just trying to read podcast URLs from a RackSpace hosted instance, and this command fixed it.
  • Brandon
    Brandon almost 6 years
    This worked for me on Kubuntu 18.04.
  • TechCode
    TechCode almost 4 years
    how to do this ??