Ana buƙatar abubuwan haɗin Java don gudanar da aikace-aikacen aikace-aikace da yanar gizo masu yawa, don haka kusan kowane mai amfani da kwamfuta yana fuskantar buƙatar shigar da wannan dandamali. Tabbas, a cikin tsarin aiki daban-daban tsarin aikin yana da bambanci, amma ga rarrabuwa na Linux koyaushe kusan ɗaya ne, amma muna son gaya yadda aka sanya Java a cikin Ubuntu. Masu mallakan sauran majalisun kawai zasu buƙaci maimaita umarnin da aka bayar, la'akari da lafazin tsarin.
Sanya Java JRE / JDK akan Linux
A yau muna ba da shawarar ku san kanku tare da zaɓuɓɓuka daban-daban don shigar da ɗakunan karatu na Java, tunda duk zasu kasance mafi amfani kuma suna aiki a wasu yanayi. Misali, idan bakaso kayi amfani da bayanga na uku ko kuma kana son sanya Java da yawa kusa, to kana bukatar amfani da wani zabi daban. Koyaya, bari mu bincika dukkan su.
Da farko, ana bada shawara don bincika sabuntawar ajiya tsarin kuma gano fasalin Java na yanzu, idan akwai, a cikin OS. Dukkan waɗannan ana yin su ta hanyar daidaitaccen wasan bidiyo:
- Bude menu kuma ka gudu "Terminal".
- Shigar da umarnin
sudo dace-samu sabuntawa
. - Shigar da kalmar wucewa daga asusunka don samun tushen tushe.
- Bayan karɓar kwantena, yi amfani da umarnin
java-baya
don duba bayanin Java da aka sanya. - Idan ka karɓi sanarwa mai kama da wanda ke ƙasa, wannan yana nuna cewa Java ba a cikin OS ɗinku.
Hanyar 1: Manyan Ma'aikata
Hanya mafi sauki ita ce amfani da kayan ajiyar don sauke Java, wanda masu haɓakawa suka buga a can. Abin sani kawai kuna buƙatar yin rijistar 'yan umarni don ƙara duk abubuwan da suka zama dole.
- Gudu "Terminal" kuma rubuta a can
sudo dace-samu shigar tsoho-jdk
sannan kuma danna Shigar. - Tabbatar da shigar da fayil ɗin.
- Yanzu ƙara JRE ta hanyar buga umarni
sudo dace-samu shigar tsoho-jre
. - Mai binciken mai bincike, wanda aka kara ta hanyar
sudo dace-samu kafa icedtea-plugin
. - Idan kuna sha'awar samun takardu game da abubuwan da aka haɗa, ku saukar da su da umarnin
sudo dace-samu shigar tsoho-jdk-doc
.
Kodayake wannan hanyar tana da sauƙi, bai dace da sanya sabbin ɗakunan karatu na Java ba, tunda ba a shimfiɗa su ba a cikin shaidun hukuma kwanan nan. Abin da ya sa muke ba da shawara cewa ku fahimci kanku da zaɓuɓɓukan shigarwa masu zuwa.
Hanyar 2: Shafin Yanar gizo
Akwai wurin ajiyar mai amfani wanda ake kira Webupd8, wanda ke da rubutun da yake kwatanta nau'in Java na yanzu da wanda yake kan shafin Oracle. Wannan hanyar shigarwa tana da amfani ga waɗanda suke so su shigar da sabon sakin 8 (na ƙarshe a cikin wurin ajiyar Oracle).
- A cikin na'ura wasan bidiyo, shigar da
sudo add-apt-mangaza ppa: webupd8team / java
. - Tabbatar hada kalmarka ta sirri.
- Tabbatar da ƙara aikin ta danna kan Shigar.
- Jira fayiloli don kammalawa ba tare da rufewa ba "Terminal".
- Sabunta ajiya na tsarin tare da umarni
sudo dace-samu sabuntawa
. - Yanzu yakamata ku ƙara mai saka hoto ta hanyar shigar
sudo mai dace-samu shigar Oracle-java8-installer
. - Yarda da lasisin lasisin don daidaita kunshin.
- Yarda da don ƙara sabon fayiloli a cikin tsarin.
A karshen aiwatarwa, umarni zai same ku don shigar da kowane irin siga -sudo mai dace-samu shigar Oracle-java7-installer
ina java7 - Sigar Java. Misali, zaka iya yin wasiyyajava9
kojava11
.
Willungiyar zata taimaka wajen kawar da rashin shigarwar da bata dace ba.sudo mai dacewa-yana cire oracle-java8-installer
ina java8 - Sigar Java.
Hanyar 3: Haɓaka Amfani da Yanar Gizo
A sama, munyi magana game da shigar da majalisai ta amfani da gidan ajiyar gidan yanar sadarwar al'ada. Godiya ga wannan ma'auni guda ɗaya, zaku iya sabunta fasalin Java zuwa sabon wanda kawai ta hanyar rubutun kwatancen.
- Maimaita matakai biyar na farko daga umarnin da suka gabata idan baku riga kun aikata waɗannan matakan ba.
- Shigar da umarnin
sudo update-java
sannan kuma danna Shigar. - Yi amfani da umarni
sudo dace-samu shigar sabunta-java
don shigar da ɗaukakawa idan an samo su.
Hanyar 4: Shigarwa na Manual
Wataƙila wannan hanyar ita ce mafi wahalar waɗanda muka bincika a cikin wannan labarin, amma zai ba ku damar samun nau'in kayan Java ɗin da ya cancanta ba tare da amfani da alamomin ɓangare na uku da sauran abubuwan haɗin gwiwa ba. Don cim ma wannan aikin, kuna buƙatar duk wata mai bincike da "Terminal".
- Ta hanyar binciken yanar gizo, jeka shafin Oracle na zazzage Java, inda ka latsa "Zazzagewa" ko zaɓi kowane sigar da kake buƙata.
- Da ke ƙasa akwai wasu kunshin tare da ɗakunan karatu. Mun bada shawara zazzage kayan tarihi tar.gz.
- Je zuwa babban fayil na kayan tarihin, danna kan shi kuma zaɓi "Bayanai".
- Tuna wurin da kunshin yake, tunda zaku shiga ta ta na'ura wasan bidiyo.
- Gudu "Terminal" da gudu umarni
cd / gida / mai amfani / babban fayil
ina mai amfani - sunan mai amfani, da babban fayil - sunan babban gidan ajiyar kayan adana kayan tarihin. - Airƙiri babban fayil don buɗe ɗakin ajiya. Yawancin lokaci ana sanya dukkan abubuwan cikin jvm. Irƙirar directory ta shiga
sudo mkdir -p / usr / lib / jvm
. - Cire babban fayil ɗin da ke cikin fayil ɗin da aka ƙirƙira
sudo tar -xf jdk-11.0.2_linux-x64_bin.tar.gz -C / usr / lib / jvm
ina jdk-11.0.2_linux-x64_bin.tar.gz - sunan kayan tarihin. - Don ƙara hanyoyin hanyoyin, kuna buƙatar shigar da waɗannan umarni masu ɗorewa:
abubuwa masu amfani da kayan juji na zamani - saiti / usr / bin / java java /usr/lib/jvm/jdk1.8.0/bin/java 1
kayan aikin sudo sabuwa-sauƙaƙa - sakawa / usr / bin / javac javac /usr/lib/jvm/jdk1.8.0/bin/javac 1
kayan aikin sudo sabuwa-sauƙaƙa - saiti / usr / bin / javaws javaws /usr/lib/jvm/jdk1.8.0/bin/javaws 1Ofaya daga cikin hanyoyi masu maye gurbin bazai wanzu ba, wanda ya dogara da zaɓaɓɓen nau'in Java.
- Ya rage kawai don aiwatar da tsarin kowane hanya. Da farko yi
sudo update-madadin --config java
, nemo samfurin da ya dace na Java, bincika lambarta kuma rubuta a cikin na'ura wasan bidiyo - Maimaita tare da
sudo update-madadin --config javac
. - Sannan saita hanyar karshe ta
sudo update-madadin --config javaws
. - Duba nasarar canje-canjen ta hanyar sanin fasalin Java ɗin (
java-baya
).
Kamar yadda kake gani, akwai hanyoyi masu yawa don shigar Java a cikin tsarin aiki na Linux, saboda haka kowane mai amfani zai sami zaɓi da ya dace. Idan kayi amfani da takamaiman kayan rarraba kuma hanyoyin da ke sama ba suyi aiki ba, a hankali bincika kurakuran da aka nuna a cikin naúbu kuma yi amfani da hanyoyin hukuma don magance matsalar.