Karolo ea Java e hlokahalang hore e sebetse ka mefuta e fapa-fapaneng ea likopo le marang-rang, kahoo hoo e batlang e le moetsi e mong le e mong oa k'homphieutha o tobane le tlhoko ea ho kenya sethaleng sena Ha e le hantle, molao-motheo oa ho etsa mosebetsi ona oa fapana ka mekhoa e fapaneng ea ts'ebetso, empa ka Linux ho fapana ho lula ho lekana, 'me re ka rata ho bolela hore na Java e kenngoa joang ho Ubuntu. Beng ba likopano tse ling ba tla hloka feela ho pheta litaelo tse fanoeng, ho nahanngoa ka lipoleloana tsa tsamaiso.
Kenya Java JRE / JDK ho Linux
Kajeno re fana ka ho tseba mekhoa e fapaneng ea tlhomamiso bakeng sa lilaebrari tsa Java, kaha kaofela li tla sebetsa haholo le ho sebetsa maemong a mang. Ka mohlala, haeba u sa batle ho sebelisa mekotla ea boraro, kapa haeba u batla ho beha likarolo tse ngata tsa Java ka thōko, joale u lokela ho sebelisa khetho e fapaneng. Leha ho le joalo, a re ke re li hlahlobeng kaofela.
Ntlha ea pele, ho kgothaletswa ho hlahloba lisebelisoa tsa polokelo ea tsamaiso le ho fumana Java ea morao-rao, haeba e teng ho OS ho hang. Sena sohle se entsoe ka se-standard console:
- Bula menyetla mme u mathe "Terminal".
- Kenya sehlopha
sudo apt-get update
. - Kenya password ea akhaonto ea hau ho fumana metso ea ho fihla.
- Ka mor'a hore u fumane liphutheloana, sebelisa taelo
java -version
ho sheba tlhahiso-leseling ka java e kentsoeng. - Haeba o amohela tsebiso e tšoanang le e ka tlaase, joale Java ha e eo ho OS.
Mokhoa oa 1: Litokomane tsa Ofisi
Mokhoa o bonolo ka ho fetisisa ke ho sebelisa lefapha la molao ho boloka Java, e leng lihlahisoa tseo lihlahisoa li li laolang moo. U tlameha ho ngolisa litaelo tse seng kae ho kenya likarolo tsohle tse hlokahalang.
- Matha "Terminal" mme u ngole moo
sudo apt-get kenya default-jdk
ebe o tobetsa Kenya. - Tiisa ho kenyelletsa ha lifaele.
- Joale eketsa JRE ka ho thapa
sudo apt-get kenya default-jre
. - Sebapali sa plugin se kenngoa ka hare
sudo apt-get kenya icedtea-plugin
. - Haeba u thahasella ho fumana litokomane tse amanang le likarolo tse ling tse ling, u li kopatse ka taelo
sudo apt-get kenya default-jdk-doc
.
Le hoja mokhoa ona o le bonolo haholo, ha o loketse ho kenya lilaebrari tse freshest tsa Java, kaha ha li e-s'o behoe mookameli oa molao morao tjena. Ke kahoo re ithaopelang ho tloaelana le dikgetho tse latelang tsa ho kenya.
Mokhoa oa 2: sebaka sa Webupd8
Ho na le polokelo ea tloaelo e bitsoang Webupd8, eo ho nang le script e bapisang phetolelo ea Java ea morao-rao le e fumanoang ho websaete ea Oracle. Mokhoa ona oa ho kenya o thusa ba batlang ho kenya lebokose le lecha la 8 (tse sa tsoa fumanoa polokelong ea Oracle).
- Ka console, kena
sudo eketsa-apt-repository ppa: webupd8team / java
. - Etsa bonnete ba hore o kenyelletsa phasewete ea hau.
- Tiisa ho eketsa ts'ebetso ka ho tobetsa Kenya.
- Emela hore file ea download e phethoe ntle le ho koala "Terminal".
- Hlahisa polokelo ea tsamaiso ka taelo
sudo apt-get update
. - Hona joale eketsa mochine oa setšoantšo ka ho thapa
sudo apt-get kenya oracle-java8-installer
. - Amohela tumellano ea tumello ea ho etsa sepakapaka ka mokhoa o tloaelehileng.
- Lumellana ho kenya lifaele tse ncha tsamaisong.
Qetellong ea tshebetso, o tla ba teng ho sehlopha ho kenya ka ho feletseng phetolelo leha e le efe -sudo apt-get kenya oracle-java7-installer
moo java7 - phetolelo ea Java. Ka mohlala, u ka ngolisajava9
kapajava11
.
Taelo e tla thusa ho felisa li-installers tse sa hlokahaleng.sudo apt-get removes oracle-java8-installer
moo java8 - phetolelo ea Java.
Mokhoa oa 3: Hlakola ka Webupd8
Ka holimo, re buile ka ho kenya likopano ka ho sebelisa sebaka sa tloaelo sa Webupd8. Ka lebaka la polokelo e le 'ngoe, u ka ntlafatsa phetolelo ea Java ho ea morao-rao feela ka script e bapisoang.
- Pheta mehato e mehlano ea pele ea lithuto tsa pele, haeba u e-s'o etse mehato ena.
- Kenya sehlopha
sudo update-java
ebe o tobetsa Kenya. - Sebelisa taelo
sudo apt-get install update-java
ho kenya lisebelisoa haeba li fumaneha.
Mokhoa oa 4: Ho kenya Mangolo
Mohlomong mokhoa ona ke o thata ka ho fetisisa ho bao re o tšohlileng sehloohong sena, empa o tla fana ka phetolelo e hlokahalang ea Java ntle le ho sebelisa lisebelisoa tsa batho ba bang le likarolo tse ling tse ling. Ho finyella mosebetsi ona o tla hloka sebapali se fumanehang le "Terminal".
- Ka sebadi sa marang-rang, e-ea leqepheng la molao la Oracle ho jarolla Java, moo u tobileng teng Kenya kapa khetha mofuta leha e le ofe o hlokahalang.
- Ka tlase ke liphutheloana tse 'maloa tse nang le lilaebraring. Re khothaletsa ho boloka mofuta oa boitsebiso. tar.gz.
- E-ea ho foldareng le archive, tobetsa ho eona RMB ebe u khetha "Matlotlo".
- Hopola sebaka sa sephutheloana, hobane u tlameha ho ea ho sona ka console.
- Matha "Terminal" 'me u phethe taelo
cd / home / user / folder
moo mosebedisi - lebitso la mosebedisi, le folder - lebitso la fensetere ea polokelo ea polokelo. - Etsa folda ho tlosa archive. Hangata likarolo tsohle li kenngoa ka jvm. Ho bopa lenaneo ho etsoa ka ho thapa
sudo mkdir -p / usr / lib / jvm
. - Tlosa li-archive tse teng ka har'a fensetere e bōpiloeng
sudo tar -xf jdk-11.0.2_linux-x64_bin.tar.gz -C / usr / lib / jvm
moo jdk-11.0.2_linux-x64_bin.tar.gz - lebitso la boitsebiso. - Ho eketsa litsela tsa tsamaiso, u lokela ho kenya litaelo tse latelang kamehla.
sudo update-mekhoa e meng-e mengata - install / usr / bin / java java /usr/lib/jvm/jdk1.8.0/bin/java 1
sudo update-mekhoa e mengata - install / usr / bin / javac javac /usr/lib/jvm/jdk1.8.0/bin/javac 1
sudo update-mekhoa e mengata - install / usr / bin / javaws javaws /usr/lib/jvm/jdk1.8.0/bin/javaws 1E 'ngoe ea litsela tse ling e ka' na ea se ke ea e-ba teng, ho ea ka phetolelo ea Java eo u e khethang.
- E sala feela ho lokisa tsela e 'ngoe le e' ngoe. Qala pele
sudo update-mekhoa e meng - e tsoetseng pele lapeng tshireletso
, fumana phetolelo e nepahetseng ea Java, netefatsa nomoro ea eona mme u kenelle konsole. - Pheta ketso e tšoanang le
sudo update-mekhoa e mengata - sefate sa javac
. - Ebe u lokisetsa tsela ea ho qetela ho feta
sudo update-mekhoa e mengata - li-jawws
. - Sheba katleho ea liphetoho ka ho fumana phetoho e sebetsang ea Java (
java -version
).
Joalokaha u ka bona, ho na le mekhoa e mengata ea ho kenya Java ho tsamaiso ea Linux, kahoo moetsi ka mong o tla fumana khetho e nepahetseng. Haeba o sebelisa kabo e khethehileng 'me mekhoa e fanoeng e sa sebetse, hlahloba ka hloko liphoso tse bonts'itsoeng ho console mme u sebelise mehloli ea molao ho rarolla bothata.