Otu esi etinye Java 17 LTS (JDK 17) na openSUSE 15 Leap

Java bụ ebumnuche n'ozuzu, klaasị, asụsụ mmemme multipurpose nke na-ewu ewu nke na-ewu ewu n'ihi nhazi nke inwe mmejuputa mmejuputa iwu dị nta, nke pụtara na koodu Java a chịkọtara nwere ike ịgba ọsọ na nyiwe niile na-akwado Java na-enweghị mkpa nchikota. Java dịkwa ngwa ngwa, nchekwa na ntụkwasị obi, yabụ. A na-eji ya maka ịmepụta ngwa Java na laptọọpụ, ebe data, consoles egwuregwu, supercomputers sayensị, ekwentị mkpanaaka, wdg.

JDK 17 (JDK 17) ewetala nkwalite asụsụ ọhụrụ, mmelite na ọba akwụkwọ, nkwado maka kọmpụta Apple ọhụrụ, mwepụ na mmebi nke njirimara nketa, yana ịrụ ọrụ iji hụ na koodu Java edere taa ga-aga n'ihu na-arụ ọrụ na-enweghị mgbanwe na ụdị JDK n'ọdịnihu.

N'ime nkuzi a, ị ga-amụta otu esi etinye Java 17 (JDK 17) kacha ọhụrụ na openSUSE 15 Leap.

Prerequisites

  • OS akwadoro: mepereSUSE Leap - 15.x 
  • Akaụntụ onye ọrụ: Akaụntụ onye ọrụ nwere sudo ma ọ bụ ohere mgbọrọgwụ.

Melite Sistemụ Ọrụ

Melite gi openSUSE Sistemụ arụmọrụ iji hụ na ngwugwu niile dị adị adịla ugbu a:

sudo zypper ume ọhụrụ -y

Bash/Shell

Nkuzi a ga-eji ya sudo iwu na na-eche na ị nwere ọnọdụ sudo.

Iji nyochaa ọkwa sudo na akaụntụ gị:

sudo whoami

Bash/Shell

Ihe atụ na-egosi ọkwa sudo:

[joshua@opennsuse ~] $ sudo whoami
mgbọrọgwụ

Bash/Shell

Ka ịtọlite ​​akaụntụ sudo dị adị ma ọ bụ ọhụrụ, gaa na nkuzi anyị na na-agbakwunye onye ọrụ na Sudoers na openSUSE.

Iji mgbọrọgwụ akaụntụ, jiri iwu na-esonụ na paswọọdụ mgbọrọgwụ banye.

su

Advertisement


Usoro 1. Wụnye JDK 17 na RPM

Ụzọ mbụ bụ ibudata RPM iji wụnye JDK 17. Usoro a dị ngwa na ngwa ngwa. Otú ọ dị, usoro a anaghị ahapụ ohere ọ bụla maka nhazi maka nrụnye, nke ndị mmepe na-ahọrọkarị.

Nke mbụ, gaa na ibe nbudata wee budata RPM kacha ọhụrụ.

Ogwe aka 64 RPM ngwugwu:

wget https://download.oracle.com/java/17/latest/jdk-17_linux-aarch64_bin.rpm

Ngwungwu x64 RPM (Kachasị):

wget https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.rpm

Na-esote, ozugbo RPM gụchara nbudata, mebie iwu a ka ịwụnye JDK 17.

sudo rpm -ivh jdk-17_linux-x64_bin.rpm

Ihe atụ mmepụta:

Preparing...                          ################################# [100%]
Updating / installing...
   1:jdk-17-2000:17-ga                ################################# [100%]
update-alternatives: using /usr/java/jdk-17/bin/java to provide /usr/bin/java (java) in auto mode

Kwado nrụnye site na ịlele ụdị ma wuo nọmba:

java --version

Ihe atụ mmepụta:

java 17 2021-09-14 LTS

Usoro 1. Wụnye JDK 17 - Usoro ntuziaka

Nhọrọ nke abụọ na nke akwadoro bụ ịwụnye Java JDK 17, ụzọ ntuziaka na-abara ndị ọrụ uru nnwere onwe na ike na ihe ha chọrọ na ebe etinyere na sistemụ ha.

Budata Java 17 Mee Kacha ọhụrụ

gaa Leta ibe nbudata ka ị nweta njikọ ụdị nrụpụta kacha ọhụrụ, wee jiri nke a iwu iwu:

curl  -O https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz

Ozugbo nbudata ahụ gwụchara, ịkwesịrị iwepụ ebe nchekwa ahụ dịka ndị a:

tar -xvf jdk-17_linux-x64_bin.tar.gz

Hazie na Wụnye JDK 17

Na-esote, bugharịa akwụkwọ ndekọ aha ewepụtara n'ime / họrọ / ebe:

sudo mv jdk-17 /opt/jdk17

Ugbu a ịkwesịrị ịtọ mgbanwe mgbanwe gburugburu ebe a:

export JAVA_HOME=/opt/jdk17
export PATH=$PATH:$JAVA_HOME/bin

Awụnyela Java 17 ugbu a. Iji gosi, jiri iwu ndị a:

java --version
echo $JAVA_HOME

Ọ bụrụ na arụnyere ya nke ọma, ị ga-ahụ nsonaazụ a:

java 17 2021-09-14 LTS
Java(TM) SE Runtime Environment (build 17+35-LTS-2724)
Java HotSpot(TM) 64-Bit Server VM (build 17+35-LTS-2724, mixed mode, sharing)
/opt/jdk17

Dị ka ị pụrụ ịhụ, ị ​​pụrụ ịhụ na mbipute bụ ọhụrụ Java 17 JDK wuru.


Advertisement


Nwalee Java 17 LTS - Mepụta ngwa ụwa ndewo

Iji mechaa, ọ na-adị mma mgbe niile ịnwale nrụnye nke ụdị ndị a iji gosi na ihe niile na-arụ ọrụ nke ọma mgbe etinyechara ya. Ụzọ dị mfe bụ ịmepụta obere edemede mmemme iji nwalee iji ihe atụ Hello World ama ama.

Mbụ, mepụta faịlụ mmemme Java dị ka ndị a

sudo nano hello.java

Ọzọ, tinye koodu Java ndị a n'ime faịlụ a:

public class hello {
  public static void main(String[] args) {
    System.out.println("G'day from LinuxCapable!");
  }
}

Chekwaa faịlụ (CTRL+O), wee pụọ (CTRL+X).

Ọzọ, chịkọta koodu:

javac hello.java

N'ikpeazụ, jiri iwu a mee koodu Java:

java hello

Ihe atụ mmepụta:

Ekele, ihe niile na-arụ ọrụ nke ọma.

Okwu na mmechi

N'ime nkuzi a, ị mụtala otu esi ebudata ma wụnye Java 17 (JDK 17) kachasị ọhụrụ. N'ozuzu, maka ndị mmepe ịkwalite Java nwere ike ịbụ ọrụ na-egbu mgbu, mana n'ime ogologo oge, ịkwalite Java 17 ga-aba uru ebumnuche ịbụ nkwado ụdị LTS ga-adị gburugburu yana nkwalite ruo oge ụfọdụ.

Ahapụ a Comment