Java Cheebtsam yuav tsum tau khiav ntau yam ntawm cov ntawv thov thiab cov vev xaib, yog li yuav luag txhua tus neeg siv computer tau ntsib nrog qhov xav tau los nruab cov platform no. Yog lawm, hauv cov kev khiav haujlwm sib txawv ntawm lub hauv paus ua haujlwm ntawm txoj haujlwm txawv, tab sis rau Linux kev faib tawm nws ib txwm hais txog tib yam, tab sis peb xav qhia seb Java yuav raug teeb tsa hauv Ubuntu li cas. Cov tswv ntawm lwm qhov kev sib sau ua ke tsuas yog yuav tsum tau rov ua cov lus qhia ua tau muab rau, coj mus rau hauv tus account lub syntax ntawm lub system.
Nruab Java JRE / JDK rau Linux
Niaj hnub no peb xav kom koj paub koj tus kheej nrog cov kev xaiv sib txawv rau nruab Java cov tsev qiv ntawv, vim txhua tus ntawm lawv yuav yog qhov muaj txiaj ntsig zoo thiab siv tau rau qee lub sijhawm. Piv txwv li, yog tias koj tsis xav siv qhov chaw thib peb tus kheej lossis yog koj xav tso ntau Java nyob ze, ces koj yuav tsum siv qhov kev xaiv cais. Txawm li cas los xij, cia peb los saib txhua qhov ntawm lawv.
Ua ntej, nws raug nquahu kom kuaj xyuas lub kaw lus cia hloov chaw thiab tshawb pom Java version tam sim no, yog tias muaj, hauv OS. Tag nrho cov no yog ua los ntawm tus nplig txheem:
- Qhib cov zaub mov thiab khiav "Chaw Nres Tsheb".
- Ntaus qhov hais kom ua
sudo apt-tau hloov tshiab
. - Ntaus tus password los ntawm koj tus lej txhawm rau nkag mus rau hauv paus.
- Tom qab tau txais cov pob khoom, siv cov lus txib
java -qauj
mus saib ntsia Java cov ntaub ntawv. - Yog tias koj tau txais kev ceeb toom zoo ib yam li daim hauv qab no, nws txhais tau tias Java tsis muaj nyob hauv koj OS.
Txoj Kev 1: Cov Chaw Tso Cai
Cov qauv yooj yim yog siv cov ntawv xa mus ua pov thawj los rub tawm Java, uas cov neeg tsim khoom tau tshaj tawm nyob rau ntawd. Koj tsuas yog yuav tsum sau npe ua ob peb nqe lus txib ntxiv rau txhua qhov tsim nyog.
- Khiav "Chaw Nres Tsheb" thiab sau muaj
sudo apt-mus nruab default-jdk
thiab nyem Sau. - Paub meej tias daim upload.
- Tam sim no ntxiv JRE los ntawm ntaus cov lus txib
sudo apt-tau nruab default-jre
. - Qhov browser plugin, uas yog ntxiv ntawm
sudo apt-tau nruab icedtea-plugin
. - Yog tias koj xav tau cov ntaub ntawv hais txog cov khoom siv ntxiv, rub lawv nrog cov lus txib
sudo apt-mus nruab default-jdk-doc
.
Txawm hais tias hom no yooj yim heev, nws tsis tsim nyog rau kev txhim kho Java cov ntawv nyeem tshiab kawg, vim lawv tsis tau tawm hauv lub chaw tso cai ntawm tsis ntev los no. Yog vim li ntawd peb xav kom koj paub koj tus kheej nrog cov kev xaiv teeb hauv qab no.
Txoj Kev 2: Webupd8 Repository
Muaj ib tus neeg siv cov chaw hu ua Webupd8, uas muaj tsab ntawv sib piv ntawm Java tam sim no nrog rau ib qho ntawm Oracle site. Qhov kev teeb tsa no yog muaj txiaj ntsig rau cov neeg uas xav los nruab qhov tshiab tso 8 (kawg muaj nyob hauv Oracle qhov chaw cia).
- Hauv lub console, nkag
sudo add-apt-repository ppa: webupd8team / java
. - Nco ntsoov sau koj tus password.
- Paub meej tias qhov ua haujlwm txuas ntxiv los ntawm txhaj rau Sau.
- Tos rau cov ntaub ntawv kom tiav yog tias tsis kaw "Chaw Nres Tsheb".
- Hloov kho lub kaw lus cia nrog cov lus txib
sudo apt-tau hloov tshiab
. - Tam sim no koj yuav tsum tau ntxiv cov graphical installer los ntawm kev nkag mus
sudo apt-tau nruab oracle-java8-installer
. - Txais daim ntawv tso cai pom zoo los teeb lub pob.
- Pom zoo ntxiv cov ntaub ntawv tshiab rau hauv cov kab ke.
Ntawm qhov kawg ntawm cov txheej txheem, ib qho lus txib yuav muaj rau koj los nruab kiag li txhua qhov version -sudo apt-mus nruab oracle-java7-installer
qhov twg java7 - Java version. Piv txwv li, koj tuaj yeem sau tshuajjava9
lossisjava11
.
Pab neeg no yuav pab kom tshem tau cov tsis tsim nyog teeb tsa.sudo apt-tau tshem oracle-java8-installer
qhov twg java8 - Java version.
Txoj Kev 3: Txhim Kho Siv Webupd8
Saum toj no, peb tau tham txog kev teeb tsa cov rooj sib txoos uas siv qhov Webupd8 kev cai lub chaw khaws khoom. Ua tsaug rau tib lub chaw cia khoom, koj tuaj yeem hloov kho version ntawm Java mus rau ib qho tshiab tshaj tawm tsuas yog txhais tau tias ntawm cov ntawv sau sib piv.
- Rov ua thawj tsib kauj ruam los ntawm cov lus qhia ua ntej yog tias koj tsis tau ua cov theem no.
- Ntaus qhov hais kom ua
sudo hloov-java
thiab nyem Sau. - Siv kev hais kom ua
sudo apt-tau nruab hloov tshiab-java
rau nruab kho tshiab yog tias lawv pom.
Txoj Kev 4: Kev Taug Kev Siv Tes
Tej zaum cov qauv no yog qhov nyuaj tshaj plaws ntawm cov uas peb tau kuaj hauv tsab xov xwm no, tab sis nws yuav cia koj kom tau txais qhov tsim nyog ntawm Java tsis tas siv cov chaw thib peb thiab lwm cov khoom siv ntxiv. Txhawm rau kom ua tiav txoj haujlwm no, koj yuav xav tau yam muaj browser thiab "Chaw Nres Tsheb".
- Hauv web browser, mus rau ntawm Oracle nplooj ntawv nplooj los rub Java, qhov twg nyem rau "Rub" lossis xaiv lwm hom version uas koj xav tau.
- Hauv qab no yog qee cov pob khoom nrog ntawv qiv. Peb pom zoo rub tawm hom ntawv khaw cia tar.gz.
- Mus rau hauv cov ntawv tais ceev tseg, nyem rau nws thiab xaiv "Khoom".
- Nco ntsoov qhov chaw ntawm pob, raws li koj yuav tsum tau mus rau nws los ntawm lub console.
- Khiav "Chaw Nres Tsheb" thiab khiav qhov hais kom ua
cd / tsev / neeg siv / nplaub tshev
qhov twg neeg siv - Lub npe username, thiab ntawv tais ceev tseg - lub npe ntawm cov ntawv cog lus khaws cia. - Tsim tus ntawv tais ceev tseg rau unzip lub archive. Feem ntau tag nrho cov Cheebtsam tso rau hauv jvm. Tsim kev qhia los ntawm kev nkag mus
sudo mkdir -p / usr / lib / jvm
. - Ntim cov ntawv qub uas twb muaj lawm rau hauv daim nplaub tshev tsim
sudo tar -xf jdk-11.0.2_linux-x64_bin.tar.gz -C / usr / lib / jvm
qhov twg jdk-11.0.2_linux-x64_bin.tar.gz - lub npe ntawm cov archive. - Txhawm rau ntxiv cov kab ke hauv lub cev, koj yuav tsum nkag mus rau cov lus txib nram qab no:
sudo hloov kho-kev xaiv - install / usr / bin / java java /usr/lib/jvm/jdk1.8.0/bin/java 1
sudo hloov-kev xaiv - nruab / usr / rau hauv / javac javac /usr/lib/jvm/jdk1.8.0/bin/javac 1
sudo hloov kho-kev xaiv - install / usr / bin / javaws javaws /usr/lib/jvm/jdk1.8.0/bin/javaws 1Ib qho ntawm lwm txoj hauv kev tsis tuaj yeem muaj nyob, uas nyob ntawm qhov xaiv ntawm Java.
- Nws tseem tshua tsuas yog nqa tawm cov kev teeb tsa ntawm txhua txoj kev. Thawj zaug ua
sudo hloov kho-kev hloov pauv --config java
, nrhiav cov version tsim nyog ntawm Java, kos nws tus lej thiab sau hauv lub console. - Rov ua rau
sudo hloov kho-kev hloov pauv --config javac
. - Tom qab ntawv teeb tsa txoj kev kawg dhau los
sudo hloov kho-kev xaiv --config javaws
. - Txheeb xyuas qhov ua tiav ntawm qhov kev hloov pauv tau los ntawm kev pom qhov nquag ntawm Java (
java -qauj
).
Raws li koj tuaj yeem pom, muaj ntau ntau ntawm cov hauv kev rau kev txhim kho Java hauv Linux operating system, yog li txhua tus neeg siv yuav pom qhov kev xaiv tsim nyog. Yog tias koj siv cov khoom siv tshwj xeeb xa tawm thiab cov hau kev saum toj no tsis ua haujlwm, ua tib zoo kawm qhov ua yuam kev uas pom hauv lub console thiab siv cov peev txheej los daws cov teeb meem.