Ho hlokahala likarolo tsa Java ho tsamaisa lits'ebetso tse ngata tse fapaneng le liwebsaete, ka hona, hoo e batlang e le mosebelisi e mong le e mong oa khomphutha o shebane le tlhoko ea ho kenya sethala sena. Ho joalo, litsamaisong tse fapaneng tsa ts'ebetso molao-motheo oa mosebetsi o fapane, empa bakeng sa phetisetso ea Linux kamehla e batla e ts'oana, empa re ka rata ho bolela hore na Java e kentsoe joang ho Ubuntu. Beng ba likopano tse ling ba tla hloka feela ho pheta litaelo tse fanoeng, ba nahanisisa ka syntax ea sistimi.
Kenya Java JRE / JDK ho Linux
Kajeno re fana ka maikutlo a hore u ithute mekhoa e fapaneng ea ho kenya lilaebrari tsa Java, hobane kaofela li tla ba molemo haholo hape li sebetsa maemong a itseng. Mohlala, haeba u sa batle ho sebelisa polokelo ea motho oa boraro kapa haeba u batla ho beha Java e 'maloa haufi, u lokela ho sebelisa khetho e arohaneng. Leha ho le joalo, a re hlahlobeng kaofela ha tsona.
Taba ea mantlha, ho khothalletsoa ho lekola lintlafatso tsa polokelo ea sistimi le ho fumana mofuta oa hona joale oa Java, haeba o teng, ho OS. Sena sohle se etsoa ka khokahano e tloaelehileng:
- Bula menyu 'me u balehe "Mokhatlo oa" terminal ".
- Kenya taelo
sudo apt-fumana ntjhafatso
. - Kenya phasewete ho tsoa akhaonteng ea hau ho fumana motso.
- Kamora ho amohela lipakete, sebelisa taelo
java -version
ho sheba tlhaiso-leseling ea Java. - Haeba u amohela tsebiso e tšoanang le e ka tlase, ho bolela hore Java ha e fumanehe ho OS ea hau.
Mokhoa oa 1: Likhosete tsa Molao
Mokhoa o bonolo ke ho sebelisa polokelo ea semmuso ho jarolla Java, eo baetsi ba eona ba e jarileng moo. U hloka feela ho ngolisa litaelo tse 'maloa ho eketsa likarolo tsohle tse hlokahalang.
- Matha "Mokhatlo oa" terminal " mme o ngole moo
sudo apt-kenya hlomamisa-jdk
ebe o tobetsa Kena. - Netefatsa uploading ea faele.
- Joale eketsa JRE ka ho thaepa taelo
sudo apt-kenya hlomamisa-jre
. - Plugin ea sebatli, e eketsoa ka
sudo apt-kenya kenya icedtea-plugin
. - Haeba u thahasella ho fumana litokomane mabapi le likarolo tse kenyelletsoeng, li jarolle ka taelo
sudo apt-kenya-default-jdk-doc
.
Le ha mokhoa ona o le bonolo, ha oa lokela ho kenya lilaebrari tsa morao-rao tsa Java, kaha ha li e-so beoe kantle ho polokelo ea molao haufinyane. Ke ka lebaka leo re fanang ka maikutlo a hore u ithute mekhoa e latelang ea ho kenya.
Mokhoa oa 2: Sebaka sa marang-rang
Ho na le polokelo ea basebelisi e bitsoang Webupd8, e nang le mongolo o bapisang mofuta oa hona joale oa Java le o mong sebakeng sa Oracle. Mokhoa ona oa ho kenya o na le thuso ho ba batlang ho kenya tse ncha tse ncha (e leng ea ho qetela e fumanehang polokelong ea Oracle).
- Ho khokahano, kenya
sudo-add-apt-repository ppa: webupd8team / java
. - Etsa bonnete ba hore u kenyelletsa password ea hau.
- Netefatsa ts'ebetso ea tlatsetso ka ho tobetsa Kena.
- Emela lifaele hore li phethe ntle le ho koala "Mokhatlo oa" terminal ".
- Ntlafatsa polokelo ea sistimi ka taelo
sudo apt-fumana ntjhafatso
. - Hona joale o lokela ho kenyelletsa sets'oants'o sa graphical ka ho kenya
Sudo apt-get or or-java8-instil
. - Amohela tumellano ea laesense ea ho hlophisa sephutheloana.
- Lumellana ho eketsa lifaele tsamaisong.
Qetellong ea ts'ebetso ena, ho tla ba le taelo ea hore u kenye mofuta oa mofuta -sudo apt-get or or-java7-kenya
kae java7 - Phetolelo ea Java. Mohlala, o ka fana ka taelojava9
kapajava11
.
Sehlopha se tla thusa ho tlosa bahlahisi ba sa hlokahaleng.sudo apt-get oracle-java8-kenya
kae java8 - Phetolelo ea Java.
Mokhoa oa 3: Ntlafatsa sebelisa Webupd8
Ka holimo, re buile ka ho kenya likopano re sebelisa polokelo ea setso ea Webupd8. Ka lebaka la polokelo e tšoanang, u ka ntlafatsa mofuta oa Java hore e be oa morao-rao ka mokhoa oa mongolo o bapisang.
- Pheta mehato ea pele e mehlano ho tsoa litaelo tse fetileng haeba ha u e-so etse mehato ena.
- Kenya taelo
sudo ntjha-java
ebe o tobetsa Kena. - Sebelisa taelo
sudo apt-kenya kenya-upva-java
ho kenya liapdeite haeba li fumanoa.
Mokhoa oa 4: Keketso ea Buka
Mohlomong mokhoa ona ke o thata haholo ho feta oo re o hlahlobileng sengolong sena, empa o tla u lumella ho fumana mofuta o hlokahalang oa Java ntle le ho sebelisa li-replication tsa motho oa boraro le likarolo tse ling tse eketsehileng. Ho etsa mosebetsi ona, o tla hloka sebatli leha e le sefe se teng mme "Mokhatlo oa" terminal ".
- E etela sebatli sa marang-rang, e ea leqepheng la semmuso la Oracle ho jarolla Java, moo u tobetsang "Khoasolla" kapa khetha mofuta o mong oo u o hlokang.
- Ka tlase ke lipakete tse ling tse nang le lilaebrari. Re khothaletsa ho jarolla pokello ea akhaonte tar.gz.
- Eya foldareng ea polokelo ea litokelo, tlanya ho eona ebe u khetha "Thepa ea matlo".
- Hopola sebaka sa sephutheloana, kaha u tlameha ho ea ho sona ka khokahanyo.
- Matha "Mokhatlo oa" terminal " mme o tsamaise taelo
cd / home / mosebelisi / foldareng
kae mosebelisi - mosebelisi, mme foldara - lebitso la polokelo ea polokelo ea polokelo ea polokelo. - Etsa phasewete ho hlakola polokelo ea pokello ea litaba. Hangata likarolo tsohle li kenngoa ka jvm. Ho etsa motsamaisi ka ho kena
sudo mkdir -p / usr / lib / jvm
. - Tšolla sethala sa khale se seng se le teng ka har'a foldara e entsoeng
sudo tar -xf jdk-11.0.2_linux-x64_bin.tar.gz -C / usr / lib / jvm
kae jdk-11.0.2_linux-x64_bin.tar.gz - lebitso la polokelo ea litaba. - Ho eketsa litsela, o tla hloka ho kenya litaelo tse latelang tatellano:
Sudo-e-ngoe-mekhoa-install / usr / bin / java java /usr/lib/jvm/jdk1.8.0/bin/java 1
Sudo-e-ngoe-mekhoa - -sstall / usr / bin / javac javac /usr/lib/jvm/jdk1.8.0/bin/javac 1
Sudo-e-mekhoa-sistere - -sstall / usr / bin / javaws javaws /usr/lib/jvm/jdk1.8.0/bin/javaws 1E 'ngoe ea litsela tse fapaneng e kanna ea se be teng, ho latela mofuta o khethiloeng oa Java.
- E sala feela ho phethahatsa tlhophiso ea tsela e 'ngoe le e' ngoe. Pele etsa
lintlafatso tsa sudo-mekhoa --config java
, fumana mofuta o nepahetseng oa Java, u hlahlobe nomoro ea eona ebe u ngola ho consolese. - Pheta hape ka
sudo-li-mekhoa tse ling --config javac
. - Ka mor'a moo, hlophisa tsela ea ho qetela
sudo-li-mekhoa-likhokahano tsaconfig
. - Lekola katleho ea liphetoho ka ho lemoha mofuta o sebetsang oa Java (
java -version
).
Joalokaha u bona, ho na le palo e kholo ea mekhoa ea ho kenya Java tsamaisong ea ts'ebetso ea Linux, kahoo mosebelisi ka mong o tla fumana khetho e loketseng. Haeba u sebelisa sesebelisoa se khethehileng sa thomello mme mekhoa e kaholimo e sa sebetse, ithute ka hloko liphoso tse bontšitsoeng ho khokahano ebe u sebelisa mehloli ea semola ho rarolla bothata.