Downloading and Installing JDK on Mac

This section describes how to download and install JDK on a macOS computer.

To learn JDBC, you need to have JDK installed on your computer. If you are Mac user, you can follow what I did to download and install JDK 21 on your Mac computer.

1. Go to Oracle Java SE download website at oracle.com/technetwork/java/javase/downloads.

2. Click "JDK 21 > macOS" tab.

3. Click on the "jdk-21_macos-x64_bin.dmg" link in the "x64 DMG Installer" line to download the installation file to your "Downloads" directory.

4. Double-click on the "jdk-21_macos-x64_bin.dmg" file to install it.

To test the installation, open a command window to try the java command.

herong$ java -version
java version "21.0.2" 2024-01-16 LTS
Java(TM) SE Runtime Environment (build 21.0.2+13-LTS-58)
Java HotSpot(TM) 64-Bit Server VM 
  (build 21.0.2+13-LTS-58, mixed mode, sharing)

Cool, I have successfully installed JDK 21 on my macOS computer!

Table of Contents

 About This Book

 JDBC (Java Database Connectivity) Introduction

JDK (Java SE) Installation

 Downloading and Installing JDK

 Adding JDK "bin" Directory to Path Setting

Downloading and Installing JDK on Mac

 Downloading and Installing JDK on Linux

 Compile and Run Java Programs

 -cp or -classpath Syntax on Different Systems

 JDK Documentation Installation

 MySQL Installation on Windows

 MySQL JDBC Driver (MySQL Connector/J)

 MySQL - PreparedStatement

 MySQL - Reference Implementation of JdbcRowSet

 MySQL - JBDC CallableStatement

 MySQL CLOB (Character Large Object) - TEXT

 MySQL BLOB (Binary Large Object) - BLOB

 Using Connection Pool with JDBC

 Archived Tutorials

 References

 Full Version in PDF/EPUB