Unable to install Jenkins on Ubuntu 18.04 due to Java incompatibility












1















I installed java default packages in Ubuntu 18.04 and tried to install Jenkins. When this did not work I searched for reasons for this and found that Jenkins needs Java 8 and the default Java in Ubuntu 18.04 is Java 10.



So, I removed all the files of Java from /usr/lib/jre folder and tried to install Java 8. It says they are already installed without downloading packages and when I tried to verify the version it said JAVA NOT FOUND.



How could I solve this issue?










share|improve this question




















  • 3





    Possible duplicate of Can't install Oracle Java 8 in Ubuntu 16.04

    – karel
    Jan 16 at 14:44






  • 1





    It is a very bad idea to try to remove software installed by package managers by deleting files. Maybe you're new to Linux and don't realise that software components are distributed to various location in the system, that packages depend on each other and that a database of what is installed is meticulously maintained by the package management system. If this database is corrupted by you making its info wrong by deleting stuff, sooner or later your system will be FUBAR and you will have great trouble figuring out how to fix it. I strongly suggest you learn to use package managers like APT.

    – Zanna
    Jan 21 at 20:43
















1















I installed java default packages in Ubuntu 18.04 and tried to install Jenkins. When this did not work I searched for reasons for this and found that Jenkins needs Java 8 and the default Java in Ubuntu 18.04 is Java 10.



So, I removed all the files of Java from /usr/lib/jre folder and tried to install Java 8. It says they are already installed without downloading packages and when I tried to verify the version it said JAVA NOT FOUND.



How could I solve this issue?










share|improve this question




















  • 3





    Possible duplicate of Can't install Oracle Java 8 in Ubuntu 16.04

    – karel
    Jan 16 at 14:44






  • 1





    It is a very bad idea to try to remove software installed by package managers by deleting files. Maybe you're new to Linux and don't realise that software components are distributed to various location in the system, that packages depend on each other and that a database of what is installed is meticulously maintained by the package management system. If this database is corrupted by you making its info wrong by deleting stuff, sooner or later your system will be FUBAR and you will have great trouble figuring out how to fix it. I strongly suggest you learn to use package managers like APT.

    – Zanna
    Jan 21 at 20:43














1












1








1








I installed java default packages in Ubuntu 18.04 and tried to install Jenkins. When this did not work I searched for reasons for this and found that Jenkins needs Java 8 and the default Java in Ubuntu 18.04 is Java 10.



So, I removed all the files of Java from /usr/lib/jre folder and tried to install Java 8. It says they are already installed without downloading packages and when I tried to verify the version it said JAVA NOT FOUND.



How could I solve this issue?










share|improve this question
















I installed java default packages in Ubuntu 18.04 and tried to install Jenkins. When this did not work I searched for reasons for this and found that Jenkins needs Java 8 and the default Java in Ubuntu 18.04 is Java 10.



So, I removed all the files of Java from /usr/lib/jre folder and tried to install Java 8. It says they are already installed without downloading packages and when I tried to verify the version it said JAVA NOT FOUND.



How could I solve this issue?







package-management software-installation java






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 21 at 20:44









Zanna

50.7k13136241




50.7k13136241










asked Aug 29 '18 at 19:09









Harsha MucherlaHarsha Mucherla

62




62








  • 3





    Possible duplicate of Can't install Oracle Java 8 in Ubuntu 16.04

    – karel
    Jan 16 at 14:44






  • 1





    It is a very bad idea to try to remove software installed by package managers by deleting files. Maybe you're new to Linux and don't realise that software components are distributed to various location in the system, that packages depend on each other and that a database of what is installed is meticulously maintained by the package management system. If this database is corrupted by you making its info wrong by deleting stuff, sooner or later your system will be FUBAR and you will have great trouble figuring out how to fix it. I strongly suggest you learn to use package managers like APT.

    – Zanna
    Jan 21 at 20:43














  • 3





    Possible duplicate of Can't install Oracle Java 8 in Ubuntu 16.04

    – karel
    Jan 16 at 14:44






  • 1





    It is a very bad idea to try to remove software installed by package managers by deleting files. Maybe you're new to Linux and don't realise that software components are distributed to various location in the system, that packages depend on each other and that a database of what is installed is meticulously maintained by the package management system. If this database is corrupted by you making its info wrong by deleting stuff, sooner or later your system will be FUBAR and you will have great trouble figuring out how to fix it. I strongly suggest you learn to use package managers like APT.

    – Zanna
    Jan 21 at 20:43








3




3





Possible duplicate of Can't install Oracle Java 8 in Ubuntu 16.04

– karel
Jan 16 at 14:44





Possible duplicate of Can't install Oracle Java 8 in Ubuntu 16.04

– karel
Jan 16 at 14:44




1




1





It is a very bad idea to try to remove software installed by package managers by deleting files. Maybe you're new to Linux and don't realise that software components are distributed to various location in the system, that packages depend on each other and that a database of what is installed is meticulously maintained by the package management system. If this database is corrupted by you making its info wrong by deleting stuff, sooner or later your system will be FUBAR and you will have great trouble figuring out how to fix it. I strongly suggest you learn to use package managers like APT.

– Zanna
Jan 21 at 20:43





It is a very bad idea to try to remove software installed by package managers by deleting files. Maybe you're new to Linux and don't realise that software components are distributed to various location in the system, that packages depend on each other and that a database of what is installed is meticulously maintained by the package management system. If this database is corrupted by you making its info wrong by deleting stuff, sooner or later your system will be FUBAR and you will have great trouble figuring out how to fix it. I strongly suggest you learn to use package managers like APT.

– Zanna
Jan 21 at 20:43










2 Answers
2






active

oldest

votes


















0














I had the same issue.



Info in repositories is not right.



If you follow logs you'll find the version you're installing is an archive. For me it was u191 today: 2019/01/16 but on website it's u201 or u202.



you have to change your repo info like this:



cd /var/lib/dpkg/info
sudo sed -i 's|JAVA_VERSION=8u191|JAVA_VERSION=8u201|' oracle-java8-installer.*
sudo sed -i 's|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/|PARTNER_URL=https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/|' oracle-java8-installer.*
sudo sed -i 's|SHA256SUM_TGZ="53c29507e2405a7ffdbba627e6d64856089b094867479edc5ede4105c1da0d65"|SHA256SUM_TGZ="cb700cc0ac3ddc728a567c350881ce7e25118eaf7ca97ca9705d4580c506e370"|' oracle-java8-installer.*
sudo sed -i 's|J_DIR=jdk1.8.0_191J_DIR=jdk1.8.0_201|' oracle-java8-installer.*


Information is on Oracle's download website.



See answers to Can't install Oracle Java 8 in Ubuntu 16.04






share|improve this answer

































    0














    Why to install and make it complicated?



    Instead of installing Jenkins using package manager sudo apt install, a better option is run Jenkins as war.




    1. Download the latest stable Jenkins WAR file to an appropriate
      directory on your machine.

    2. Open up a terminal/command prompt window to the download directory.

    3. Run the command java -jar jenkins.war.

    4. Browse to http://localhost:8080 and wait until the Unlock Jenkins page appears.


    By default Jenkins runs on port 8080, change port using java -jar jenkins.war --httpPort=9090





    To keep jenkins running on Ubuntu even after terminal is closed, use



    nohup java -jar jenkins.war --httpPort=9090 &


    See Installing Jenkins for more options.






    share|improve this answer























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1070241%2funable-to-install-jenkins-on-ubuntu-18-04-due-to-java-incompatibility%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      I had the same issue.



      Info in repositories is not right.



      If you follow logs you'll find the version you're installing is an archive. For me it was u191 today: 2019/01/16 but on website it's u201 or u202.



      you have to change your repo info like this:



      cd /var/lib/dpkg/info
      sudo sed -i 's|JAVA_VERSION=8u191|JAVA_VERSION=8u201|' oracle-java8-installer.*
      sudo sed -i 's|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/|PARTNER_URL=https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/|' oracle-java8-installer.*
      sudo sed -i 's|SHA256SUM_TGZ="53c29507e2405a7ffdbba627e6d64856089b094867479edc5ede4105c1da0d65"|SHA256SUM_TGZ="cb700cc0ac3ddc728a567c350881ce7e25118eaf7ca97ca9705d4580c506e370"|' oracle-java8-installer.*
      sudo sed -i 's|J_DIR=jdk1.8.0_191J_DIR=jdk1.8.0_201|' oracle-java8-installer.*


      Information is on Oracle's download website.



      See answers to Can't install Oracle Java 8 in Ubuntu 16.04






      share|improve this answer






























        0














        I had the same issue.



        Info in repositories is not right.



        If you follow logs you'll find the version you're installing is an archive. For me it was u191 today: 2019/01/16 but on website it's u201 or u202.



        you have to change your repo info like this:



        cd /var/lib/dpkg/info
        sudo sed -i 's|JAVA_VERSION=8u191|JAVA_VERSION=8u201|' oracle-java8-installer.*
        sudo sed -i 's|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/|PARTNER_URL=https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/|' oracle-java8-installer.*
        sudo sed -i 's|SHA256SUM_TGZ="53c29507e2405a7ffdbba627e6d64856089b094867479edc5ede4105c1da0d65"|SHA256SUM_TGZ="cb700cc0ac3ddc728a567c350881ce7e25118eaf7ca97ca9705d4580c506e370"|' oracle-java8-installer.*
        sudo sed -i 's|J_DIR=jdk1.8.0_191J_DIR=jdk1.8.0_201|' oracle-java8-installer.*


        Information is on Oracle's download website.



        See answers to Can't install Oracle Java 8 in Ubuntu 16.04






        share|improve this answer




























          0












          0








          0







          I had the same issue.



          Info in repositories is not right.



          If you follow logs you'll find the version you're installing is an archive. For me it was u191 today: 2019/01/16 but on website it's u201 or u202.



          you have to change your repo info like this:



          cd /var/lib/dpkg/info
          sudo sed -i 's|JAVA_VERSION=8u191|JAVA_VERSION=8u201|' oracle-java8-installer.*
          sudo sed -i 's|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/|PARTNER_URL=https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/|' oracle-java8-installer.*
          sudo sed -i 's|SHA256SUM_TGZ="53c29507e2405a7ffdbba627e6d64856089b094867479edc5ede4105c1da0d65"|SHA256SUM_TGZ="cb700cc0ac3ddc728a567c350881ce7e25118eaf7ca97ca9705d4580c506e370"|' oracle-java8-installer.*
          sudo sed -i 's|J_DIR=jdk1.8.0_191J_DIR=jdk1.8.0_201|' oracle-java8-installer.*


          Information is on Oracle's download website.



          See answers to Can't install Oracle Java 8 in Ubuntu 16.04






          share|improve this answer















          I had the same issue.



          Info in repositories is not right.



          If you follow logs you'll find the version you're installing is an archive. For me it was u191 today: 2019/01/16 but on website it's u201 or u202.



          you have to change your repo info like this:



          cd /var/lib/dpkg/info
          sudo sed -i 's|JAVA_VERSION=8u191|JAVA_VERSION=8u201|' oracle-java8-installer.*
          sudo sed -i 's|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/|PARTNER_URL=https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/|' oracle-java8-installer.*
          sudo sed -i 's|SHA256SUM_TGZ="53c29507e2405a7ffdbba627e6d64856089b094867479edc5ede4105c1da0d65"|SHA256SUM_TGZ="cb700cc0ac3ddc728a567c350881ce7e25118eaf7ca97ca9705d4580c506e370"|' oracle-java8-installer.*
          sudo sed -i 's|J_DIR=jdk1.8.0_191J_DIR=jdk1.8.0_201|' oracle-java8-installer.*


          Information is on Oracle's download website.



          See answers to Can't install Oracle Java 8 in Ubuntu 16.04







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 21 at 20:39









          Zanna

          50.7k13136241




          50.7k13136241










          answered Jan 16 at 14:26









          ClimberdavClimberdav

          12




          12

























              0














              Why to install and make it complicated?



              Instead of installing Jenkins using package manager sudo apt install, a better option is run Jenkins as war.




              1. Download the latest stable Jenkins WAR file to an appropriate
                directory on your machine.

              2. Open up a terminal/command prompt window to the download directory.

              3. Run the command java -jar jenkins.war.

              4. Browse to http://localhost:8080 and wait until the Unlock Jenkins page appears.


              By default Jenkins runs on port 8080, change port using java -jar jenkins.war --httpPort=9090





              To keep jenkins running on Ubuntu even after terminal is closed, use



              nohup java -jar jenkins.war --httpPort=9090 &


              See Installing Jenkins for more options.






              share|improve this answer




























                0














                Why to install and make it complicated?



                Instead of installing Jenkins using package manager sudo apt install, a better option is run Jenkins as war.




                1. Download the latest stable Jenkins WAR file to an appropriate
                  directory on your machine.

                2. Open up a terminal/command prompt window to the download directory.

                3. Run the command java -jar jenkins.war.

                4. Browse to http://localhost:8080 and wait until the Unlock Jenkins page appears.


                By default Jenkins runs on port 8080, change port using java -jar jenkins.war --httpPort=9090





                To keep jenkins running on Ubuntu even after terminal is closed, use



                nohup java -jar jenkins.war --httpPort=9090 &


                See Installing Jenkins for more options.






                share|improve this answer


























                  0












                  0








                  0







                  Why to install and make it complicated?



                  Instead of installing Jenkins using package manager sudo apt install, a better option is run Jenkins as war.




                  1. Download the latest stable Jenkins WAR file to an appropriate
                    directory on your machine.

                  2. Open up a terminal/command prompt window to the download directory.

                  3. Run the command java -jar jenkins.war.

                  4. Browse to http://localhost:8080 and wait until the Unlock Jenkins page appears.


                  By default Jenkins runs on port 8080, change port using java -jar jenkins.war --httpPort=9090





                  To keep jenkins running on Ubuntu even after terminal is closed, use



                  nohup java -jar jenkins.war --httpPort=9090 &


                  See Installing Jenkins for more options.






                  share|improve this answer













                  Why to install and make it complicated?



                  Instead of installing Jenkins using package manager sudo apt install, a better option is run Jenkins as war.




                  1. Download the latest stable Jenkins WAR file to an appropriate
                    directory on your machine.

                  2. Open up a terminal/command prompt window to the download directory.

                  3. Run the command java -jar jenkins.war.

                  4. Browse to http://localhost:8080 and wait until the Unlock Jenkins page appears.


                  By default Jenkins runs on port 8080, change port using java -jar jenkins.war --httpPort=9090





                  To keep jenkins running on Ubuntu even after terminal is closed, use



                  nohup java -jar jenkins.war --httpPort=9090 &


                  See Installing Jenkins for more options.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 27 at 2:56









                  r_Dr_D

                  11




                  11






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1070241%2funable-to-install-jenkins-on-ubuntu-18-04-due-to-java-incompatibility%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Human spaceflight

                      Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

                      張江高科駅