0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Java JDKインストール Ubuntu

Posted at

JDKをUbuntuへのインストール方法を共有いたします。
環境:Apple M1 computer

cat /etc/os-relase
PRETTY_NAME="Ubuntu 24.04.1 LTS"

システムを更新する。
$ sudo apt update

JDKバージョンを確認する。
$ apt-cache search openjdk

openjdk-17-jdk, openjdk-8-jdk, openjdk-21-jdkがありますけれど、21を選ぶ。

$ sudo apt install -y openjdk-21-jdk
OpenJDK version "21.0.4" 2024-07-16
OpenJDK Runtime Environment
OpenJDK 64-bit Server VM

$ javac -version
javac 21.0.4

テスト用のJavaコード
$ cat Hello.java
public class Hello{
public static void main(String[] args){
System.out.println("Hello");
}
}

$ javac Hello.java
$ java Hello
Hello

$ which java
/usr/bin/java

インストール完了

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?