Izici zeJava ziyadingeka ukusebenzisa izinhlobo eziningi zezicelo kanye namawebhusayithi, ngakho-ke cishe wonke umsebenzisi wekhompyutha ubhekene nesidingo sokufaka le nkundla. Vele, ezinhlelweni zokusebenza ezahlukahlukene umgomo womsebenzi uhlukile, kepha ekusakazweni kweLinux kuhlale kufana, kepha singathanda ukusho ukuthi iJava ifakwa kanjani Ubuntu. Abanikazi beminye imihlangano bazodinga kuphela ukuphinda imiyalo enikezwe, kucatshangelwa syntax yesistimu.
Faka iJava JRE / JDK kwiLinux
Namuhla siphakamisa ukuthi uzijwayeze ngezinketho ezahlukene zokufaka imitapo yolwazi yeJava, ngoba wonke azoba wusizo kakhulu futhi asebenza ezimweni ezithile. Isibonelo, uma ungafuni ukusebenzisa amakhosombe avela eceleni noma uma ufuna ukubeka ama-Java ambalwa eduzane, kuzodingeka usebenzise inketho ehlukile. Kodwa-ke, ake sibhekisise bonke.
Okokuqala, kunconyelwa ukuthi kuhlolwe izibuyekezo zesitoreji sohlelo futhi uthole uhlobo lwamanje lweJava, uma lukhona, ku-OS. Konke lokhu kwenziwa ngekhonsoli ejwayelekile:
- Vula imenyu bese uqala "Isiginali".
- Faka umyalo
ukuvuselelwa kwesudo
. - Faka iphasiwedi kwi-akhawunti yakho ukuze uthole ukufinyelela kwezimpande.
- Ngemuva kokuthola amaphakheji, sebenzisa umyalo
java -version
ukubuka imininingwane efakiwe yeJava. - Uma uthola isaziso esifana nalesi esingezansi, kusho ukuthi iJava ayitholakali ku-OS yakho.
Indlela yoku-1: Izikhumbuzo Ezisemthethweni
Indlela elula ukusebenzisa i-repository esemthethweni ukulanda i-Java, abayilayishe lapho. Udinga nje kuphela ukubhalisa imiyalo embalwa ukwengeza zonke izinto ezidingekayo.
- Gijima "Isiginali" bese ubhala lapho
sudo apt-get ukufaka okuzenzakalelayo-jdk
bese uqhafaza Ngena. - Qinisekisa ukulayishwa kwefayela.
- Manje engeza i-JRE ngokuthayipha umyalo
sudo apt-get ukufaka okuzenzakalelayo-jre
. - I-plugin yesiphequluli, engezwa nge
sudo apt-get ufake icedtea-plugin
. - Uma unesifiso sokuthola imibhalo ephathelene nezinto ezingeziwe, zilande ngomyalo
sudo apt-get ukufaka okuzenzakalelayo-jdk-doc
.
Yize le ndlela ilula impela, ayifanelekile ukufaka imitapo yolwazi yakamuva yeJava, ngoba ibingakabekwa endaweni yokugcina esemthethweni muva nje. Kungakho siphakamisa ukuthi uzijwayeze lezi zinketho zokufaka ezilandelayo.
Indlela Yesibili: I-Webupd8 Repository
Kukhona ikhosombe lomsebenzisi elibizwa ngeWebupd8, elinesikripthi esiqhathanisa inguqulo yamanje yeJava naleyo ese site yeOracle. Le ndlela yokufaka ilusizo kulabo abafuna ukufaka ukukhishwa okusha kwe-8 (okugcina kutholakala endaweni yokubeka yase-Oracle).
- Kwikhonsoli, faka
i-sudo-add-apt-repository ppa: webupd8team / java
. - Qiniseka ukufaka iphasiwedi yakho.
- Qinisekisa ukungezwa kokusebenza ngokuchofoza Ngena.
- Lindela amafayela aqede ngaphandle kokuvala "Isiginali".
- Vuselela isitoreji sohlelo ngomyalo
ukuvuselelwa kwesudo
. - Manje kufanele wengeze ukufakwa kwesithombe ngokufaka
I-sudo apt-get ukufaka i-oracle-java8-isifaki
. - Yamukela isivumelwano selayisense ukumisa iphakheji.
- Vuma ukungeza amafayela amasha ohlelweni.
Ekupheleni kwenqubo, kuzotholakala umyalo wokuthi ungafaka ngokuphelele noma yiluphi uhlobo -I-sudo apt-get ukufaka i-oracle-java7-isifaki
kuphi java7 - Uhlobo lweJava. Isibonelo, ungabekajava9
nomajava11
.
Iqembu lizosiza ukuqeda abagxeki abangafanele.sudo apt-get ukususa oracle-java8-Isifaki
kuphi java8 - Uhlobo lweJava.
Indlela 3: Thuthukisa Usebenzisa iWebupd8
Ngaphezulu, sikhulume ngokufaka imihlangano sisebenzisa ikhosombe lokunakekela leWebupd8. Ngenxa yesidalwa esifanayo, ungabuyekeza inguqulo yeJava ibe yamuva nje ngesikripthi sokuqhathanisa.
- Phinda izinyathelo ezinhlanu zokuqala emiyalweni edlule uma ungakazenzi lezi zinyathelo.
- Faka umyalo
sudo buyekeza-java
bese uqhafaza Ngena. - Sebenzisa umyalo
sudo apt-get ukufaka ukubuyekeza-java
ukufaka izibuyekezo uma zitholakala.
Indlela 4: Ukufaka ngesandla
Mhlawumbe le ndlela inzima kakhulu kunaleyo esayihlolisisa kule ndatshana, kepha izokuvumela ukuthi uthole inguqulo edingekayo yeJava ngaphandle kokusebenzisa okubhalwe eceleni nezinye izinto ezengeziwe. Ukuze ufeze lo msebenzi, uzodinga noma yisiphi isiphequluli esikhona futhi "Isiginali".
- Nge-isiphequluli sewebhu, iya ekhasini elisemthethweni le-Oracle ukulanda i-Java, lapho uchofoza khona "Landa" noma khetha noma iyiphi enye inguqulo oyifunayo.
- Ngezansi kunamaphakheji athile anemitapo yolwazi. Sincoma ukulanda umlando wokugcina umlando tar.gz.
- Iya kufolda yokufaka kungobo yomlando, chofoza kuyo bese ukhetha "Izindawo".
- Khumbula indawo yephakeji, njengoba kuzodingeka uye kuyo ngokusebenzisa ikhonsoli.
- Gijima "Isiginali" futhi ugijime umyalo
cd / ikhaya / umsebenzisi / ifolda
kuphi umsebenzisi - igama lomsebenzisi, futhi ifolda - Igama lefolda yesilondolozi sokugcina umlando. - Dala ifolda ukuze uvule umlando. Imvamisa zonke izakhi zibekwa kwi-jvm. Ukwakha isiqondisi ngokungena
sudo mkdir -p / usr / lib / jvm
. - Vula ingobo yomlando esele kufolda eyakhiwe
sudo tar -xf jdk-11.0.2_linux-x64_bin.tar.gz -C / usr / lib / jvm
kuphi jdk-11.0.2_linux-x64_bin.tar.gz - Igama le-Archive. - Ukwengeza izindlela zohlelo, uzodinga ukufaka imiyalo elandelayo ngokulandelana:
izindlela zokuvuselela ze-sudo -install / usr / bin / java java /usr/lib/jvm/jdk1.8.0/bin/java 1
izindlela zokuvuselela ze-sudo -install / usr / bin / javac javac /usr/lib/jvm/jdk1.8.0/bin/javac 1
izindlela zokuvuselela ze-sudo -install / usr / bin / i-jaaws /usr/lib/jvm/jdk1.8.0/bin/javaws 1Enye yezindlela ezihlukile kungenzeka ukuthi ayikho, okuncike enguqulweni ekhethiwe yeJava.
- Kuhlala kuphela ukufeza ukucushwa kwendlela ngayinye. Okokuqala yenza
izindlela zokuvuselela ze-sudo --config java
, thola inguqulo efanelekile yeJava, hlola inombolo yayo bese ubhala kukhonsoli. - Phinda nge
izindlela zokuvuselela ze-sudo - ezinye ze -config
. - Ngemuva kwalokho lungiselela indlela yokugcina
izindlela zokuvuselela ze-sudo - ezinye ze -config
. - Hlola impumelelo yezinguquko ngokubona inguqulo esebenzayo yeJava (
java -version
).
Njengoba ukwazi ukubona, kunezindlela eziningi zokufaka iJava ohlelweni lokusebenza lwe-Linux, ngakho umsebenzisi ngamunye uzothola inketho efanelekile. Uma usebenzisa ikhithi ethile yokusabalalisa futhi izindlela ezingenhla zingasebenzi, funda ngokucophelela amaphutha akhonjiswe kukhonsoli bese usebenzisa imithombo esemthethweni ukuxazulula inkinga.