Site icon Learning & Doing

Cara Install Oracle Java Pada Ubuntu 20.04 / Debian 11

java

“Cara Install Oracle Java Pada Ubuntu 20.04 / Debian 11”

Pengertian

Java adalah bahasa pemrograman populer yang digunakan untuk pengembangan Aplikasi Desktop, Game, aplikasi Seluler, dan banyak lainnya. Ubuntu 20.04 dirilis baru-baru ini dan sekarang siap untuk digunakan Produksi. Sebagai Pengembang Java, Anda ingin menginstal Java default yang tersedia di Ubuntu 20.04.

Install Java pada Ubuntu 20.04 / Debian 11

sudo apt update
apt policy default-jdk
sudo apt install default-jdk default-jre
The following NEW packages will be installed:
  at-spi2-core ca-certificates-java default-jdk default-jdk-headless default-jre default-jre-headless fontconfig-config fonts-dejavu-core
  fonts-dejavu-extra java-common libatk-bridge2.0-0 libatk-wrapper-java libatk-wrapper-java-jni libatk1.0-0 libatk1.0-data libatspi2.0-0
  libavahi-client3 libavahi-common-data libavahi-common3 libcups2 libdrm-amdgpu1 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libfontconfig1
  libfontenc1 libgif7 libgl1 libgl1-mesa-dri libglapi-mesa libglvnd0 libglx-mesa0 libglx0 libice-dev libice6 libjpeg-turbo8 libjpeg8 liblcms2-2
  libllvm9 libnspr4 libnss3 libpciaccess0 libpcsclite1 libpthread-stubs0-dev libsensors-config libsensors5 libsm-dev libsm6 libvulkan1
  libwayland-client0 libx11-dev libx11-xcb1 libxau-dev libxaw7 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-randr0 libxcb-shape0
  libxcb-sync1 libxcb1-dev libxcomposite1 libxdamage1 libxdmcp-dev libxfixes3 libxft2 libxi6 libxinerama1 libxkbfile1 libxmu6 libxpm4 libxrandr2
  libxrender1 libxshmfence1 libxt-dev libxt6 libxtst6 libxv1 libxxf86dga1 libxxf86vm1 mesa-vulkan-drivers openjdk-11-jdk openjdk-11-jdk-headless
  openjdk-11-jre openjdk-11-jre-headless x11-common x11-utils x11proto-core-dev x11proto-dev xorg-sgml-doctools xtrans-dev
0 upgraded, 92 newly installed, 0 to remove and 18 not upgraded.
Need to get 296 MB of archives.
After this operation, 794 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
java -version
openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-3ubuntu1)
OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-3ubuntu1, mixed mode, sharing)

Test Java

cat > HelloWorld.java <<HELLO
public class HelloWorld {
  public static void main(String[] args) {
    System.out.println("Hello World!");
  }
}
HELLO
java HelloWorld.java
sudo update-alternatives --config java

Penutup

Sahabat Blog Learning & Doing demikianlah penjelasan mengenai Cara Install Oracle Java Pada Ubuntu 20.04 / Debian 11. Semoga Bermanfaat . Sampai ketemu lagi di postingan berikut nya.

Exit mobile version