Uyifaka njani iJava ku-Ubuntu

uphawu lweJava

IJava yaphuhliswa nguLanga (ngoku ophethwe yiOracle) phaya ngo-1992, kwaye yavela kwimfuno yokwenza iqonga eliza kuvumela ukukhula kwe ikhowudi yemvelaphi kwindalo iphela. Umbono ibikukukhulisa usetyenziso olunokuthi lwenziwe kuyo nayiphi na inkqubo yokusebenza enenkxaso yeJava emva koko yenziwe kuyo nayiphi na enye ngaphandle kwesidingo sokulungiswa, ekwigazari eyaziwa ngokuba yiWORA kanye, yenza naphi na »).

Injalo indlela IJava iyenzile kwiinkqubo ezinkulu zokusebenza njengeWindows, iMac OS X (ngelo xesha, iMacOS) kunye neLinux. Kule meko icacileyo, ngokufika kwii-distros ezininzi, nangona ingezizo zonke iinkqubo zephakeji eziyifaka ngendlela enobuhlobo okanye zibonelela ngohlobo olutsha. Kwaye kwezinye iimeko ezaziwayo njengezo Ubuntu, kufuneka sithathe imizuzwana embalwa ukufaka zombini ixesha lokubaleka le-Java kunye ne-SDK yayo ukuba sikhetha (okanye kufuneka siqale ukuphuhlisa ikhowudi).

Ngoku makhe sibone uyifaka njani iJava ku-Ubuntu, into engenzima kwaphela, nangona ifuna amanyathelo athile anokucaca, ngakumbi kuba okwangoku sinethuba lokufaka zombini ingxelo yeOracle's Java-Oko kukuthi, esemthethweni- kunye ne-OpenJDK, ephuhliswe uluntu kwaye oko kwaqala njengokubheja kwikamva xa kungacacanga ukuba yeyiphi indima kaJava malunga nesimo sayo sengqondo kuyo. software free.

Ukuhambelana phakathi kwezi zinto zimbini ngama-99,9 epesenti, kodwa ngokobuqu ndicinga ukuba kuqeqesho olwenza izinto zibe lula kuthi ukuba sifuna ukusebenza kwinkampani kulungele ukuziqhelanisa kangangoko nezixhobo ezisemthethweni. Umzekelo, kwimeko yeJava kuluncedo ngakumbi ukufunda ukusebenzisa I-Netbeans okanye i-Eclipse kwaye usebenzise i-Oracle's Java. Ke, into yokuqala kukujonga ukuba xa ufaka i-distro yethu iza ne-OpenJDK:

java -version

Inkqubo iyakubuyisa ulwazi lwe Inguqulelo yeJava siyifakile, umzekelo into efana 'ne-OpenJDK Runtime Environment' ukuba sinenguqulo ye-OpenJDK. Ukuba bekunjalo, singayikhupha nge:

sudo apt-fumana ukucoca i-openjdk - *

Ngoku sinesiqinisekiso esipheleleyo sokususa yonke into enxulumene nofakelo lwangaphambili lweJava, ukuqala ngokucocekileyo. Inyathelo lokuqala kukwenza iifolda okanye imikhombandlela apho siza kufaka ingxelo entsha, kwaye oku kulula kakhulu:

Isudo mkdir -p / usr / yendawo / iJava

Emva koko kufuneka Khuphela iJava SDK Ukunika ingqalelo ekhethekileyo ukuba yeyiphi ehambelana nenkqubo yethu, oko kukuthi, ama-32 okanye ama-64 amasuntswana, kuba umzekelo iJava yee-bits ezingama-64 ayizukusebenza ngokuchanekileyo kwiinkqubo ezingama-32 kwaye iya kusinika iimpazamo zazo zonke iintlobo. Sikopa ukukhuphela kwifolda esiyenzileyo kwinyathelo elidlulileyo, sisebenzisa:

cp jdk-8-linux-x64.tar.gz / usr / yengingqi / java

Emva koko sibeka thina kulawulo kwaye siyivule iziphu:

I-tar -xvf jdk-8-linux-x64.tar.gz

Ngalo myalelo, i Ukukhuphela iJava, Kwaye iya kuba ngaphakathi kwifolda ebesiyenzile ngaphambili, into efana nale / usr / yengingqi / java / jdk8, kwaye ngaphakathi kwayo zonke iifolda ezisezantsi eziyinxalenye yefayile ecinezelekileyo esiyikhupheleyo.

Sisebenza kakuhle, kwaye kuncinci okuseleyo kodwa sinesinyathelo esibalulekileyo ekufuneka sisenzile kwaye oko kukwenza inkqubo ichonge imiyalelo yeJava ukuze sikwazi ukuyenza ngaphandle kokungena kuyo yonke indlela kodwa ngokuchwetheza nje umyalelo othile, njenge javat IJavac. Oku kubizwa ngokuba 'kukongeza kwindlela' kwaye kulula ukuyenza kuba kufuneka silungise umxholo wefayile / njl / iprofayili. Ngale nto sisebenzisa umhleli wokubhaliweyo wokhetho lwethu, kwimeko yam iGedit:

Isudo gedit / njl / iprofayile

kwaye sidibanisa oku kulandelayo:

Java_HOME = / usr / yengingqi / java / jdk8
INDLELA = $ INDLELA: $ IKHAYA / bin: $ Java_HOME / bin
thumela ngaphandle Java_HOME
ukuthumela PATH

Sigcina utshintsho, kwaye ngoku sinalo yongeza olu fakelo lweJava kwindawo yogcino lwedatha yenkqubo yethu, Esenza ngalo myalelo hlaziya-ezinye iindlela.

Ngalo myalelo sazisa inkqubo yokuba i-Oracle Java JRE, JDK kunye neJava Webstart ziyafumaneka:

uhlaziyo lwe-sudo-ezinye iindlela-ukufaka "/ usr / bin / java" "java" "/ usr / yendawo / ijava / jdk8 / bin / java" 1

uhlaziyo lwesudo-ezinye iindlela -ifakela "/ usr / bin / javac" "javac" "/ usr / local / java / jdk8 / bin / javac" 1

uhlaziyo lwe-sudo-ezinye iindlela-ukufaka "/ usr / bin / javaws" "javaws" "/ usr / yendawo / java / jdk8 / bin / javaws" 1

Ngoku masenze setha i-Oracle Java njengexesha lokubaleka elingagqibekanga yenkqubo:

uhlaziyo lwe-sudo-ezinye iindlela -setha iJava / usr / yendawo / iJava / jdk8 / bin / java

uhlaziyo lwe-sudo-ezinye iindlela -setha i-javac / usr / yendawo / iJava / jdk8 / bin / javac

uhlaziyo lwe-sudo-ezinye iindlela -setha ijavaws / usr / yendawo / iJava / jdk8 / bin / javaws

Yiyo leyo, sigqibile ngofakelo, kwaye sinokuyiqinisekisa ngokwenza nje umyalelo wokuqala kwakhona kwaye siqinisekise ngokusisindisa:

Java -uhlaziyo,

Njengoko siza kubona, sele siza kuqhuba ixesha lokubaleka le-Oracle Java kuhlaziyo lwayo lwamva nje.

Iinkcukacha ezithe xaxe - Ubuntu inokuba nesona sikhangeli silungileyo kwihlabathi kunye neyakho, I-Netbeans kwi-Ubuntu, uyifaka njani i-IDE kwi-Ubuntu (I) yethu


Umxholo wenqaku uyabambelela kwimigaqo yethu imigaqo yokuziphatha yokuhlela. Ukuxela impazamo cofa apha.

Izimvo ezi-13, shiya ezakho

Shiya uluvo lwakho

Idilesi yakho ye email aziyi kupapashwa.

*

*

  1. Uxanduva lwedatha: UMiguel Ángel Gatón
  2. Injongo yedatha: Ulawulo lwe-SPAM, ulawulo lwezimvo.
  3. Umthetho: Imvume yakho
  4. Unxibelelwano lwedatha: Idatha ayizukuhanjiswa kubantu besithathu ngaphandle koxanduva lomthetho.
  5. Ukugcinwa kweenkcukacha
  6. Amalungelo: Ngalo naliphi na ixesha unganciphisa, uphinde uphinde ucime ulwazi lwakho.

  1.   IJaumet sitsho

    Konke oku ukufaka iJava, emva koko uzimisele ukuba abantu basuke kwi-windows xp baye kwi-linux, nceda… .. Yi-chimera, nakweyiphi na imeko iilayisensi zeewindows 7 ziya kunyuka, ndicinga ukuba lo unyaka awuzukuba ngunyaka Nokuba ilinux ……
    Iindaba ezimnandi njenge paragon yesoftware yasimahla kunye nezinto ezintle ongakhetha kuzo kwimithombo evulekileyo nangezinye ii-chimera….

    I-Canonical ivala Ubuntu enye ngokusilela ukukhuphisana nemfazwe yexabiso leenkonzo zemfazwe

  2.   UWilly klew sitsho

    IJaumet, kuyacaca ukuba le nkqubo iyadinisa kodwa ukufaka izixhobo zophuhliso kwiWindows ayisiyonto ilula (umzekelo izixhobo zophuhliso lwe-Android).
    URodrigo, ngamanye amaxesha ndiyifakile iJava ngale ndlela, kodwa kule meko ndikhangele isisombululo esichanekileyo. Kwaye ukuba ngenye imini iPPA iyeke ukugcinwa okanye ukuhlaziywa apho uhlala khona, ngelixa kule nkqubo sinika iinkcukacha kufuneka sihlaziye kuphela ulawulo apho sifaka khona iJava kunye neenguqulelo ezintsha, kwaye ekubeni isakhiwo seJDK sihlala amakhonkco afanayo okomfuziselo kunye nokungeniswa kwe-PATH kuya kuhlala kuchanekile, nokuba sine Java 8, Java 8.1, Java 9 okanye nantoni na.

    Nibuliso!

  3.   dani sitsho

    Ndizamile, kodwa ngomyalelo wokuqala wokufaka, i-terminal ijongeka ngathi ayisiyonto, ndingagcina imiyalelo engenzi nto, andazi ukuba kuyakufuneka ndilinde ithutyana okanye hayi, kodwa ekugqibeleni, mna ubuyile kwi-openjdk, ayonto imbi

  4.   UWilly klew sitsho

    UDani, ayothusi loo nto undixelela
    ungandixelela iziphumo zomyalelo

    Isudo / usr / sbin / uhlaziyo-ezinye iindlela -config java

    Nibuliso!

  5.   Javier sitsho

    Sihlobo, yonke into yayihamba kakuhle. Kodwa xa ndichwetheza le miyalelo

    uhlaziyo lwe-sudo-ezinye iindlela-ukufaka "/ usr / bin / javac" "javac" "/ usr / local / java / jdk8 / bin / javac" 1

    uhlaziyo lwe-sudo-ezinye iindlela-ukufaka "/ usr / bin / javaws" "javaws" "/ usr / local / java / jdk8 / bin / javaws" 1

    Impazamo: enye ikhonkco ayiphelelanga njengoko kufanele ukuba: "/ usr / bin / javac"

    Olunye uhlaziyo lwesudo-iindlela ezizezinye-ukufaka "/ usr / bin / java" "java" "/ usr / local / java / jdk8 / bin / java" 1 ayindiniki mpazamo.

    Kwaye xa ndibhala Java -version. Ndiyifumana le

    Inguqulelo yeJava "1.8.0_05"
    IJava (TM) SE Indawo yokusiNgqongileyo (yakha i-1.8.0_05-b13)
    IJava HotSpot (TM) i-64-Bit Server VM (yakha i-25.5-b02, imowudi exubeneyo)

    Andazi nokuba ibifakwe kakuhle na. kuba xa ubhala kwikhonsoli yejaacac ayiyiboni.

    Ndingaluvuyela uncedo lwakho.

    1.    Mna ngokwam sitsho

      ngaphambi kokufaka akukho script ukuba awunjalo ewe-faka

  6.   hector sitsho

    Molo ngokuhlwa nje, ingcebiso nje okoko ndizamile ukulandela le khosi kodwa ndicinga ukuba inkcazo ethe kratya ilahlekile ngaphandle kokuba eminye imiyalelo ayipelwanga kakuhle kwaye iphawula iimpazamo ezininzi ezinje ngengxaki kule ngcaciso ingentla.

  7.   UBrayan lopez sitsho

    Ndiphi apha kuxwebhu kwi-gdit ekufuneka ndiyongezile?

    Java_HOME = / usr / yengingqi / java / jdk8
    INDLELA = $ INDLELA: $ IKHAYA / bin: $ Java_HOME / bin
    thumela ngaphandle Java_HOME
    ukuthumela PATH

  8.   UFederico Silva sitsho

    Ndinengxaki, ndingu-newbie kwaye ndalandela isifundo ngendlela yokufaka ileta kwileta, kodwa xa ndicela ukukhupha umxholo "jdk-8u31-linux-x64.tar.gz" ulawulo, I Ithi ukusebenza akuvumelekanga kwaye ayindivumeli ndikhuphe. Ndingenza ntoni?

    1.    UMiguel Torres sitsho

      Molweni kubo bonke abahlobo, namhlanje ndiye ndangumsebenzisi weLinux Mint kwaye ndangena kule ngxaki kuba ndifuna ukusebenzisa iJava 8

      kwaye ukulandela la manyathelo ndagijimela kwiingxaki ezifanayo nezakho.
      kwaye sele ndiyisombulule, zezimpazamo ze-syntax kuphela ukuba ufuna uncedo undongeze ku-Skype nebneru85@hotmail.com kwaye ndiyisombulula ingxaki yemibuliso

  9.   UJimmy Olano sitsho

    Ngemvume yakho: apha "siyavusa" amangeniso kwaye siqinisekisa ukuba akho ngoku, ngoLwesibini, nge-06 kaDisemba ngo-2016 (okwangoku ukuba awunamdla woku, COFA kwelinye ikhonkco okanye uvale le thebhu yesikhangeli sakho sewebhu) ,
    SIQALA:

    Sikhipha ngokufaka igama eligqithisiweyo 'lengcambu':

    sudo apt-fumana ukucoca i-openjdk - *

    Ikhonkco lokukhuphela i-jdk-8-linux-x64.tar.gz (jonga uhlobo lweprosesa kunye ne-GNULinux distro, sisebenzisa Ubuntu16 64 bits):

    http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

    *** Ukusukela namhlanje 2016-12dic-06 eneneni iphakheji inegama jdk-8u111-linux-x64.tar.gz ***

    Ukukopa ifayile ecinezelweyo ekhutshiweyo kwaye ukhuphe umxholo wayo, umyalelo "sudo" kufuneka wandulelwe ngaphambi komgca ngamnye wento eboniswe apha kwesi sifundo (kwimeko yethu sisebenzisa Ubuntu16 64-bit, iliso):

    I-sudo cp jdk-8u111-linux-x64.tar.gz / usr / yendawo / yejava /
    I-sudo cp jdk-8u111-linux-x64.tar.gz / usr / yendawo / yejava /
    I-sudo tar -xvf jdk-8u111-linux-x64.tar.gz

    Xa usenza umyalelo wangaphambili ifolda «/usr/local/java/jdk1.8.0_111» yenziwe, ngalo mzuzu ukuba singena «iJava -version» kumgca wokuyalela isixelela ukuba siyifake kunye »Kwinto ekufuneka siyixelele inkqubo yethu yokusebenza APHO IBHALWE khona ngokuguqula 'iprofayili':

    gksudo gedit / njl / iprofayile

    QAPHELA ukuba sisebenzisa "gksudo" kuba siza kusebenzisa i-gedit esebenzisa ujongano lomzobo, SISEBENZISA JIKELELE "nano" kwaye umyalelo uya kuba " umhleli wombhalo okhethiweyo unonxibelelwano lomzobo, sebenzisa "gksudo".

    SONGEZA imigca eboniswe kwesi sifundo:

    Java_HOME = / usr / yengingqi / java / jdk8
    INDLELA = $ INDLELA: $ IKHAYA / bin: $ Java_HOME / bin
    thumela ngaphandle Java_HOME
    ukuthumela PATH

    (Sukushiya iithebhu okanye izithuba kwifayile yethu / njl / yefayile, yongeza ekupheleni kwefayile).

    Emva koko sisebenzisa ezinye iindlela zokuhlaziya ukuhambisa kwakhona i-distros ye-GNULinux (qaphela ukusetyenziswa kweekowuti ezizodwa, ukusetyenziswa kweZIKHUMBUZO EZIMBINI -ukufaka kunye nokwahluka kwindlela yeephakheji zethu zenguqu jdk1.8.0_111 -kwikhompyuter yakho mhlawumbi yahlukile- ):

    uhlaziyo lwe-sudo-ezinye iindlela -ifakela '/ usr / bin / java' 'java' '/usr/local/java/jdk1.8.0_111/bin/java' 1
    uhlaziyo lwe-sudo-ezinye iindlela -ifakela '/ usr / bin / javac' 'javac' '/usr/local/java/jdk1.8.0_111/bin/javac' 1
    uhlaziyo lwe-sudo-ezinye iindlela-ukufaka '/ usr / bin / javaws' 'javaws' '/usr/local/java/jdk1.8.0_111/bin/javaws' 1

    Ngoku siza kuseta i-Oracle Java njengexesha lokubaleka lenkqubo (kwakhona qaphela ukusetyenziswa kokuphindaphindwa kabini ku -set kunye -kunye- indlela yethu ingahluka kwindlela yakho kwikhompyuter yakho):

    uhlaziyo lwe-sudo-ezinye iindlela -setha i-java / usr / yendawo / iJava / jdk1.8.0_111/bin/java
    uhlaziyo lwe-sudo-ezinye iindlela -setha i-javac / usr / yendawo / iJava / jdk1.8.0_111/bin/javac
    uhlaziyo lwe-sudo-ezinye iindlela -setha ijavaws /usr/local/java/jdk1.8.0_111/bin/javaws

    UKUGQIBELA JONGA IVEKI YETHU EFAKILEYO (iya kubuyisa into enje-kuxhomekeke kwinguqulelo yakho ye-GNULinux distro):

    Jimmy @ KEVIN: /usr/local/java/jdk1.8.0_111$ java -version
    Inguqulelo yeJava "1.8.0_111"
    IJava (TM) SE Indawo yokusiNgqongileyo (yakha i-1.8.0_111-b14)
    IJava HotSpot (TM) i-64-Bit Server VM (yakha i-25.111-b14, imowudi exubeneyo)
    jimmy @ KEVIN: / usr/local/java/jdk1.8.0_111$

    Ndiyathemba ukuba umsebenzi wale nkonzo ithobekileyo UYA KUSETYENZISWA, enkosi ngokundivumela ukuba ndipapashe amava ethu kwaye ke sabelane ngolwazi lwamahala #SoftwareLibre 😎, atte. UJimmy Olano.

  10.   UYesu sitsho

    inyani yokuba "ukukopa" le miyalelo kunye nokuncamathisela kwisiphelo sendlela, yeyona nto indinike impazamo, ukongeza kwiqhagamshela eliphindwe kabini kwi- * -install * eyayiyimfuneko, kwaye indlela yeJava yayingalunganga, ndincoma ukuyibhala Inyathelo nenyathelo