Otu esi etinye Java 16 (OpenJDK 16) na Debian 11

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.

N'ime nkuzi a, ị ga-amụta otu esi etinye Java 16 kacha ọhụrụ (OpenJDK 16) na Debian 11 Bullseye.

Prerequisites

  • OS akwadoro: Nnenna 11 Bullseye
  • Akaụntụ onye ọrụ: Akaụntụ onye ọrụ nwere sudo ihe ùgwù or ohere mgbọrọgwụ (su Command).
  • Ngwungwu achọrọ: wget

Na-emelite Sistemụ Ọrụ

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

sudo apt update && sudo apt upgrade

Mgbọrọgwụ ma ọ bụ Sudo Access

Site na ndabara, mgbe ị mepụtara akaụntụ gị na mmalite na Debian ma e jiri ya tụnyere nkesa ndị ọzọ, ọ naghị enweta ọkwa sudoers ozugbo. Ị ga-enwerịrị ike ịnweta ya mgbọrọgwụ paswọọdụ iji iwu su ma ọ bụ gaa na nkuzi nkuzi anyị Otu esi etinye onye ọrụ na Sudoers na Debian.

Wụnye ngwugwu CURL

Nkuzi ga-eji ihe ngwugwu curl ibudata igodo GPG; mbụ, chọpụta ma ọ bụrụ na ngwugwu dị:

curl --version

Mwepụta ihe atụ ma ọ bụrụ arụnyere:

curl 7.74.0 (x86_64-pc-linux-gnu) libcurl/7.74.0 OpenSSL/1.1.1k zlib/1.2.11 brotli/1.0.9 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.3.0) libssh2/1.9.0 nghttp2/1.43.0 librtmp/2.3
Release-Date: 2020-12-09

Ọ bụrụ na itinyeghị curl, jiri iwu a:

sudo apt install curl -y

Advertisement


Wụnye Java OpenJDK 16 – DPKG

Wụnye Java 16

Nhọrọ dị mfe mana nke kachasị mmachi bụ ịwụnye Java OpenJDK 16 site na iji dpkg iwu, nke bụ ngwá ọrụ iji wụnye, wuo, wepụ na jikwaa ngwugwu Debian

Mbụ, budata ngwugwu .deb site na Ibe nbudata Java:

Ihe Nlereanya:

Otu esi etinye Java 16 (OpenJDK 16) na Debian 11

Ozugbo etinyere ya, gaa na ndekọ aha ị budatara Java na; na ndabara, nke a ga-abụ ndekọ nbudata:

cd /home/username/Downloads

Ozugbo ibudatara ngwugwu .deb, mee iwu na-esonụ na njedebe gị ka ịwụnye Java:

sudo dpkg -i jdk-16.0.2_linux-x64_bin.deb

Ihe atụ mmepụta:

Otu esi etinye Java 16 (OpenJDK 16) na Debian 11

Wepu Java 16

Ọ bụrụ na ịchọghị OpenJDK 16 wee tinye ngwanro a site na iji ngwugwu .deb JDK, ị nwere ike iji iwu dpkg na-eso ya na nhọrọ ọkọlọtọ -r ga-ewepụ ngwugwu ahụ dịka ọmụmaatụ n'okpuru:

sudo dpkg -r jdk-16.0.2

Ihe atụ mmepụta:

Otu esi etinye Java 16 (OpenJDK 16) na Debian 11

Wụnye Java OpenJDK 16 – Nhọrọ ntuziaka

Nhọrọ nke abụọ na nke akwadoro bụ ịwụnye OpenJDK 16, ụzọ ntuziaka na-abara ndị ọrụ uru na nnwere onwe na ike karịa ihe ha chọrọ yana ebe etinyere na sistemụ ha.

Budata Java 16 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.java.net/java/GA/jdk16.0.2/d4a915d82b4c4fbb9bde534da945d746/7/GPL/openjdk-16.0.2_linux-x64_bin.tar.gz

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

tar -xvf openjdk-16.0.2_linux-x64_bin.tar.gz

Hazie ma wụnye Java 16

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

sudo mv jdk-16.0.2 /opt/

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

export JAVA_HOME=/opt/jdk-16.0.2
export PATH=$PATH:$JAVA_HOME/bin

Awụnyela Java 16 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:

openjdk 16.0.2 2021-07-20
OpenJDK Runtime Environment (build 16.0.2+7-67)
OpenJDK 64-Bit Server VM (build 16.0.2+7-67, mixed mode, sharing)
/opt/jdk-16.0.2

Dị ka ị pụrụ ịhụ, ị ​​pụrụ ịhụ na mbipute bụ ọhụrụ 16.0.2 na-ewu.


Advertisement


Nwalee Java - 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 ụwa ndewo a ma 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:

Otu esi etinye Java 16 (OpenJDK 16) na Debian 11

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

Okwu na mmechi

N'ime nkuzi a, ị mụtala otu esi ebudata ma wụnye Java 16 (OpenJDK 16) ụdị kachasị ọhụrụ, yana nbudata na ụdị n'ọdịnihu yana ịwụnye otu usoro maka sistemụ arụmọrụ Debian 11 Bullseye gị.

Idenye aha
Gwa nke
0 Comments
Inline nzaghachi
Lee echiche niile
0
Ga-ahụ n'anya gị echiche, biko okwu.x