Yuav Ua Li Cas Nruab Oracle Java JRE ntawm Linux Ubuntu (nrog Duab)

Cov txheej txheem:

Yuav Ua Li Cas Nruab Oracle Java JRE ntawm Linux Ubuntu (nrog Duab)
Yuav Ua Li Cas Nruab Oracle Java JRE ntawm Linux Ubuntu (nrog Duab)

Video: Yuav Ua Li Cas Nruab Oracle Java JRE ntawm Linux Ubuntu (nrog Duab)

Video: Yuav Ua Li Cas Nruab Oracle Java JRE ntawm Linux Ubuntu (nrog Duab)
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Kaum ib hlis
Anonim

Kab lus no yuav npog kev txhim kho 32-ntsis thiab 64-ntsis Oracle Java 7 JRE (tus lej tam sim no yog 1.8.0_73) ntawm 32-ntsis thiab 64-ntsis Ubuntu kev ua haujlwm. Phau ntawv qhia no tseem siv rau Debian thiab Linux Mint. Kab lus no yog hais txog xwb yog tias koj xav teeb tsa Oracle Java JRE ntawm Debian raws Linux system, piv txwv li Debian, Ubuntu thiab Linux Mint. Siv txoj kev no, koj xwb tuaj yeem khiav thiab ua tiav cov haujlwm Java thiab tsis tuaj yeem tsim kho thiab ua haujlwm hauv Java. Kab lus no tau tsim los vim muaj ntau qhov kev thov los ntawm lwm tus neeg siv uas xav paub yuav ua li cas xwb nruab Oracle Java JRE ntawm tus tswv Ubuntu system. Kuv kuj tau suav nrog ntu ntu yuav ua li cas thiaj pab tau Oracle Java JRE hauv lub vev xaib thiab siv txoj hauv kev no. Phau ntawv qhia no ua haujlwm ntawm Debian, Ubuntu, thiab Linux Mint.

Kauj ruam

Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 1
Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 1

Kauj Ruam 1. Txheeb xyuas seb Ubuntu Linux operating system yog 32-ntsis lossis 64-ntsis architecture, qhib lub davhlau ya nyob twg thiab khiav cov lus txib hauv qab no

  • Hom/Luam/Muab Tshuaj:

    cov ntaub ntawv /sbin /init

    Ua tib zoo saib me ntsis ntawm koj li Ubuntu Linux system architecture, txawm tias 32-ntsis lossis 64-ntsis

Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 2
Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 2

Kauj Ruam 2. Txheeb xyuas yog tias Java tau teeb tsa ntawm koj lub kaw lus

Txhawm rau ua qhov no, koj yuav tsum tau khiav Java version ntawm cov lus txib los ntawm lub davhlau ya nyob twg.

  • Qhib lub davhlau ya nyob twg thiab nkag mus rau cov lus txib hauv qab no:

    • Hom/Luam/Muab Tshuaj:

      java -version

  • Yog tias koj muaj OpenJDK teeb tsa ntawm koj lub kaw lus, nws yuav tsum zoo li no:

    • java version "1.7.0_15"

      OpenJDK Runtime Environment (IcedTea6 1.10pre) (6b15 ~ pre1-0lucid1)

      OpenJDK 64-Bit Server VM (tsim 19.0-b09, hom sib xyaw)

  • Yog tias OpenJDK tau teeb tsa ntawm koj lub kaw lus, koj tau teeb tsa tus muag khoom tsis raug ntawm Java rau txoj kev no.
Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 3
Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 3

Kauj Ruam 3. Tshem OpenJDK/JRE los ntawm kab ke thiab tsim cov npe los tuav Oracle Java JRE binary

Qhov no yuav tiv thaiv kev tsis sib haum xeeb thiab tsis meej pem ntawm cov neeg muag khoom sib txawv ntawm Java. Piv txwv, yog tias koj lub kaw lus muaj OpenJDK/JRE, tshem nws los ntawm kev ntaus cov lus txib hauv qab no hauv kab hais kom ua:

  • Hom/Luam/Muab Tshuaj:

    sudo apt-tau tshem tawm openjdk-\*

    Cov lus txib no yuav tshem tawm OpenJDK/JRE los ntawm koj lub cev tag nrho

  • Hom/Luam/Muab Tshuaj:

    sudo mkdir -p/usr/zos/java

    Cov lus txib no yuav tsim cov npe los tuav Oracle Java JDK thiab JRE binaries

Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 4
Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 4

Kauj Ruam 4. Rub tawm Oracle Java JRE rau Linux

Xyuas kom tseeb tias koj xaiv cov compressed binary uas Yog lawm rau koj 32-ntsis lossis 64-ntsis system architecture (cov uas xaus rau hauv tar.gz).

  • Piv txwv li, yog tias koj siv 32-ntsis Ubuntu Linux kev ua haujlwm, rub tawm 32-ntsis Oracle Java binary.
  • Piv txwv li, yog tias koj siv 64-ntsis Ubuntu Linux operating system, rub tawm 64-ntsis Oracle Java binary.
  • Rub tawm Oracle Java JDK/JRE Cov ntaub ntawv (yeem).

    Xaiv jdk-7u40-apidocs.zip

  • Cov ntaub ntawv tseem ceeb:

    64-ntsis Oracle Java binary tsis ua haujlwm ntawm 32-ntsis Ubuntu Linux operating system. Koj yuav tau txais tus lej yuam kev yog tias koj sim teeb tsa Oracle Java 64-ntsis ntawm Linux Ubuntu 32-ntsis.

Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 5
Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 5

Kauj Ruam 5. Luam Oracle Java binary mus rau/usr/local/java directory

Feem ntau Oracle Java binary tau rub mus rau: /home /"koj_user_name"/Rub tawm.

  • Qhia rau txhim kho Oracle Java 32-ntsis ntawm Linux Ubuntu 32-ntsis:

    • Hom/Luam/Muab Tshuaj:

      cd /tsev /"koj_user_name"/Rub tawm

    • Hom/Luam/Muab Tshuaj:

      sudo cp -r jre-8u73-linux-i586.tar.gz/usr/local/java

    • Hom/Luam/Muab Tshuaj:

      cd/usr/zos/java

  • Oracle Java 64-ntsis teeb tsa kev qhia ntawm Linux Ubuntu 64-ntsis:

    • Hom/Luam/Muab Tshuaj:

      cd /tsev /"koj_user_name"/Rub tawm

    • Hom/Luam/Muab Tshuaj:

      sudo cp -r jre-8u73-linux-x64.tar.gz/usr/local/java

    • Hom/Luam/Muab Tshuaj:

      cd/usr/zos/java

Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 6
Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 6

Kauj Ruam 6. Khiav cov lus txib hauv qab no ntawm rub tawm Oracle Java tar.gz file

Nco ntsoov tias koj ua nws li hauv paus kom nws tuaj yeem ua tiav los ntawm txhua tus neeg siv ntawm cov kab ke. Txhawm rau qhib lub hauv paus dav hlau, ntaus sudo -s thiab koj yuav raug nug kom nkag mus rau tus password.

  • Qhia rau txhim kho Oracle Java 32-ntsis ntawm Linux Ubuntu 32-ntsis:

    • Hom/Luam/Muab Tshuaj:

      sudo chmod a+x jre-8u73-linux-i586.tar.gz

  • Oracle Java 64-ntsis teeb tsa kev qhia ntawm Linux Ubuntu 64-ntsis:

    • Hom/Luam/Muab Tshuaj:

      sudo chmod a+x jre-8u73-linux-x64.tar.gz

Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 7
Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 7

Kauj Ruam 7. Qhib compressed Java binary, hauv phau ntawv teev npe/usr/local/java

  • Qhia rau txhim kho Oracle Java 32-ntsis ntawm Linux Ubuntu 32-ntsis:

    • Hom/Luam/Muab Tshuaj:

      sudo tar xvzf jre-8u73-linux-i586.tar.gz

  • Oracle Java 64-ntsis teeb tsa kev qhia ntawm Linux Ubuntu 64-ntsis:

    • Hom/Luam/Muab Tshuaj:

      sudo tar xvzf jre-8u73-linux-x64.tar.gz

Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 8
Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 8

Kauj Ruam 8. Txheeb xyuas koj phau ntawv teev npe

Txog tam sim no, qhov sib tw tsis sib xws yog nyob hauv/usr/local/java directory rau Java JDK/JRE uas tau teev tseg raws li:

  • Hom/Luam/Muab Tshuaj:

    ls -ib

  • jre1.8.0_73
Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 9
Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 9

Kauj Ruam 9. Kho cov kab ke kab ke system /etc /profile thiab ntxiv cov kab ke hauv qab no hauv koj txoj kab ke

Siv nano, gedit, lossis lwm tus kho ntawv, raws li hauv paus, mus rau /etc /profile.

  • Hom/Luam/Muab Tshuaj:

    sudo gedit /etc /profile

  • los yog
  • Hom/Luam/Muab Tshuaj:

    sudo nano /thiab /profile

Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 10
Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 10

Kauj Ruam 10. Nqes mus rau qhov kawg ntawm cov ntawv siv cov xub tuav thiab ntxiv kab hauv qab no thaum kawg ntawm /etc /profile file:

  • Hom/Luam/Muab Tshuaj:

    JAVA_HOME =/usr/zos/java/jre1.8.0_73

    PATH = $ PATH: $ HOME/bin: $ JAVA_HOME/bin

    export JAVA_HOME

    export PAJ

Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 11
Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 11

Kauj Ruam 11. Txuag cov ntaub ntawv /etc /profile thiab tawm mus

Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 12
Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 12

Kauj Ruam 12. Qhia koj li Oracle Java JRE qhov twg koj li Linux Ubuntu system yog

Yog li, cov kab ke paub tias Oracle Java version tshiab tuaj yeem siv tau.

  • Hom/Luam/Muab Tshuaj:

    sudo hloov tshiab-lwm -install "/usr/bin/java" "java" "/usr/local/java/jre1.8.0_73/bin/java" 1

    Cov lus txib no ceeb toom rau lub system tias Oracle Java JRE tab tom ua haujlwm

  • Hom/Luam/Muab Tshuaj:

    sudo hloov kho-hloov pauv-nruab "/usr/bin/javaws" "javaws" "/usr/local/java/jre1.8.0_73/bin/javaws" 1

    Cov lus txib no ceeb toom rau lub system tias Oracle Java Web pib tuaj yeem siv tau

Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 13
Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 13

Kauj Ruam 13. Qhia koj li Linux Ubuntu system tias Oracle Java JRE yuav tsum yog Java default

  • Hom/Luam/Muab Tshuaj:

    sudo hloov tshiab-lwm -set java /usr/local/java/jre1.8.0_73/bin/java

    Cov lus txib no yuav teeb tsa Java ib puag ncig kev ua haujlwm rau koj lub cev

  • Hom/Luam/Muab Tshuaj:

    sudo hloov tshiab-lwm -set javaws /usr/local/java/jre1.8.0_73/bin/javaws

    Cov lus txib no yuav teeb tsa Web pib Java rau koj li kab ke

Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 14
Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 14

Kauj Ruam 14. Rov qab qhib koj qhov system thoob plaws PATH /etc /profile los ntawm kev ntaus cov lus txib hauv qab no:

  • Hom/Luam/Muab Tshuaj:

    . /thiab/profile

  • Nco ntsoov tias cov kab ke thoob plaws PATH cov ntaub ntawv /etc /profile yuav rov pib dua tom qab koj li Linux Ubuntu system tau rov pib dua.
Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 15
Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 15

Kauj Ruam 15. Kuaj los ntsuas yog tias Oracle Java raug teeb tsa raug rau koj li kab ke

Khiav cov lus txib hauv qab no thiab nco ntsoov Java version:

Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 16
Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 16

Kauj Ruam 16. Kev ua tiav 32-nws Oracle Java kev teeb tsa yuav tso tawm:

  • Hom/Luam/Muab Tshuaj:

    java -version

    Cov lus txib no qhia txog version ntawm Java khiav ntawm koj lub kaw lus

  • Koj yuav tsum tau txais cov lus uas hais tias:

    • java version "1.8.0_05"

      Java (TM) SE Runtime Environment (tsim 1.8.0_05-b18)

      Java HotSpot (TM) Server VM (tsim 24.45-b08, hom sib xyaw)

Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 17
Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 17

Kauj Ruam 17. Kev ua tiav 64-ntsis Oracle Java kev teeb tsa yuav tso tawm:

  • Hom/Luam/Muab Tshuaj:

    java -version

    Cov lus txib no qhia txog version ntawm Java khiav ntawm koj lub kaw lus

  • Koj yuav tsum tau txais cov lus uas hais tias:

    • java version "1.8.0_73"

      Java (TM) SE Runtime Environment (tsim 1.8.0_05-b18)

      Java HotSpot (TM) 64-Bit Server VM (tsim 24.45-b08, hom sib xyaw)

Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 18
Nruab Oracle Java JRE ntawm Ubuntu Linux Kauj Ruam 18

Kauj Ruam 18. Nrog koj zoo siab, koj tau teeb tsa Oracle Java JRE ntawm koj li Linux system

Tam sim no rov pib dua koj li Ubuntu Linux system. Tom qab ntawd, koj lub kaw lus yuav raug teeb tsa kom khiav Java cov haujlwm.

Yeem: Yuav Ua Li Cas Pab Tau Oracle Java hauv Web Browser

Txhawm rau pab Java plug-ins hauv lub vev xaib, koj yuav tsum tsim lub cim txuas los ntawm lub vev xaib browser plug-in directory mus rau qhov chaw ntawm Java plug-in suav nrog hauv koj Oracle Java faib

Cov Ntaub Ntawv Tseem Ceeb:

Koj yuav tsum tau ceev faj heev thaum ua haujlwm Oracle Java 8 hauv lub vev xaib vim muaj ntau qhov yuam kev thiab kev nyab xeeb siv. Hauv qhov tseem ceeb, yog tias koj pab kom Oracle Java 8 hauv koj lub vev xaib, koj lub cev tsis muaj zog los tawm tsam los ntawm cov neeg phem. Yog xav paub ntau ntxiv txog kev ruaj ntseg Java, mus saib lub vev xaib no: Java Tester

Google Chrome

Oracle Java 32-ntsis Qhia:

  1. Nkag mus rau cov lus txib hauv qab no.

    • Hom/Luam/Muab Tshuaj:

      sudo mkdir -p/opt/google/chrome/plugins

      Cov lus txib no yuav tsim cov npe hu ua/opt/google/chrome/plugins

    • Hom/Luam/Muab Tshuaj:

      cd/opt/google/chrome/plugins

      Qhov no yuav tig koj mus rau hauv Google Chrome phau ntawv qhia ntxiv-ons. Nco ntsoov tias koj nyob hauv phau ntawv teev npe no thaum tsim cov cim txuas

    • Hom/Luam/Muab Tshuaj:

      sudo ln -s /usr/local/java/jre1.8.0_73/lib/ib 386/libnpjp2.so

      Lub cim txuas yuav raug tsim los ntawm Java JRE (Java Runtime Environment) ntxiv-on libnpjp2.so rau koj Google Chrome.

Oracle Java 64-ntsis Qhia:

  1. Nkag mus rau cov lus txib hauv qab no.

    • Hom/Luam/Muab Tshuaj:

      sudo mkdir -p/opt/google/chrome/plugins

      Koj yuav tsim cov npe hu ua/opt/google/chrome/plugins

    • Hom/Luam/Muab Tshuaj:

      cd/opt/google/chrome/plugins

      Qhov no yuav tig koj mus rau hauv Google Chrome phau ntawv qhia ntxiv-ons. Nco ntsoov tias koj nyob hauv phau ntawv teev npe ua ntej tsim lub cim txuas

    • Hom/Luam/Muab Tshuaj:

      sudo ln -s /usr/local/java/jre1.8.0_05/lib/amd64 ua/libnpjp2.so

      Lub cim txuas yuav raug tsim los ntawm Java JRE (Java Runtime Environment) ntxiv-on libnpjp2.so rau koj Google Chrome.

Nco ntsoov:

  1. Sau ntawv:

    Qee zaum thaum koj nkag mus rau cov lus txib saum toj no, cov lus hauv qab no yuav tshwm sim:

    • ln: tsim cov cim txuas `./libnpjp2.so ': Cov ntaub ntawv muaj nyob
    • Txhawm rau kho qhov teeb meem no, yooj yim tshem tawm cov cim txuas yav dhau los siv cov lus txib hauv qab no:
    • Hom/Luam/Muab Tshuaj:

      cd/opt/google/chrome/plugins

    • Hom/Luam/Muab Tshuaj:

      sudo rm -rf libnpjp2.so

    • Nco ntsoov tias koj nyob hauv/opt/google/chrome/plugins directory ua ntej nkag mus rau qhov hais kom ua
  2. Rov qab qhib lub vev xaib thiab mus ntsib Java Tester los sim yog tias Java ua haujlwm hauv lub vev xaib.

    Mozilla Firefox

    Oracle Java 32-ntsis Qhia:

    1. Nkag mus rau cov lus txib hauv qab no.

      • Hom/Luam/Muab Tshuaj:

        cd/usr/lib/mozilla/plugins

        Cov lus txib no yuav hloov koj mus rau hauv/usr/lib/mozilla/plugins directory. Tsim cov npe no yog tias nws tsis muaj lawm

      • Hom/Luam/Muab Tshuaj:

        sudo mkdir -p/usr/lib/mozilla/plugins

        Cov lus txib no yuav tsim cov npe/usr/lib/mozilla/plugins. Nco ntsoov tias koj nyob hauv phau ntawv teev npe no ua ntej tsim lub cim txuas

      • Hom/Luam/Muab Tshuaj:

        sudo ln -s /usr/local/java/jre1.8.0_73/lib/ib 386/libnpjp2.so

        Koj lub cim txuas yuav raug tsim los ntawm Java JRE (Java Runtime Environment) ntxiv libnpjp2.so rau koj Mozilla Firefox.

    Oracle Java 64-ntsis Qhia:

    1. Nkag mus rau cov lus txib hauv qab no.

      • Hom/Luam/Muab Tshuaj:

        cd/usr/lib/mozilla/plugins

        Qhov no yuav hloov koj mus rau/usr/lib/mozilla/plugins directory. Tsim cov npe no yog tias nws tsis muaj lawm

      • Hom/Luam/Muab Tshuaj:

        sudo mkdir -p/usr/lib/mozilla/plugins

        Cov lus txib no yuav tsim cov npe/usr/lib/mozilla/plugins. Nco ntsoov tias koj nyob hauv cov npe no ua ntej tsim cov cim txuas

      • Hom/Luam/Muab Tshuaj:

        sudo ln -s /usr/local/java/jre1.8.0_73/lib/amd64 ua/libnpjp2.so

        Lub cim txuas yuav raug tsim los ntawm Java JRE (Java Runtime Environment) ntxiv-on libnpjp2.so rau koj Mozilla Firefox.

    Nco ntsoov:

    1. Sau ntawv:

      Qee lub sij hawm thaum cov lus txib tau nkag mus cov lus yuav tshwm sim uas hais tias:

      • ln: tsim cov cim txuas `./libnpjp2.so ': Cov ntaub ntawv muaj nyob
      • Txhawm rau kho nws, tsuas yog tshem tawm cov cim txuas yav dhau los siv cov lus txib hauv qab no:
      • Hom/Luam/Muab Tshuaj:

        cd/usr/lib/mozilla/plugins

      • Hom/Luam/Muab Tshuaj:

        sudo rm -rf libnpjp2.so

      • Nco ntsoov tias koj nyob hauv/usr/lib/mozilla/plugins cov npe ua ntej nkag mus rau qhov hais kom ua.
    2. Rov pib dua koj lub vev xaib thiab mus ntsib Java Tester los sim yog tias Java ua haujlwm tau zoo hauv qhov browser.

Pom zoo: