How to Install the JDK (Java Development Kit) on a Mac
Visit the JDK download page., Download the JDK installer., Double-click the downloaded installer., Follow the prompts to install the JDK., Delete the DMG file after installation (optional)., Open NetBeans from the Applications folder., Click File...
Step-by-Step Guide
-
Step 1: Visit the JDK download page.
Open your web browser and visit oracle.com/downloads/index.html. -
Step 2: Download the JDK installer.
Once you're on the Downloads page, you'll need to navigate to the installer files:
Click the "Java" option.
Click "Java SE." Click the "Download" button next to "JDK 8 with NetBeans." Select "Accept License Agreement" and then click the download link for "Mac OS X" in the top section.
This is the most recent release of the Java SDK with the NetBeans development environment. , The installer is in .dmg format.
Double-clicking it will open the installation interface. , You'll be asked to enter your administrator password before installation can proceed. , This will help you save on disk space, since you don't need it after the JDK has been installed., This is the development environment for Java, and will allow you to easily write and compile code. , This will start a new project in NetBeans. , This will set NetBeans to create Java files for this project. , For this example, call it "HelloWorld." This will open the code editor after the project is created. , Your program code will go underneath this line. , Press ⏎ Return after the "// TODO code application goes here" line to create a new line with the same indentation.
Type the following code:
System.out.println("Hello World!") -
Step 3: Double-click the downloaded installer.
This looks like a green Play button, and can be found in the toolbar. , This frame will appear at the bottom of your screen after running the project. , If the project doesn't have any errors, you'll see "Hello World!" and "BUILD SUCCESSFUL" in the Output tab.
If there are errors, you'll see which lines they occur on so that you can go back and fix them., Now that you have the JDK installed and working, you can continue learning to program in Java.
See Write Your First Program in Java for more beginner guides. -
Step 4: Follow the prompts to install the JDK.
-
Step 5: Delete the DMG file after installation (optional).
-
Step 6: Open NetBeans from the Applications folder.
-
Step 7: Click File and select "New Project."
-
Step 8: Select the "Java" category and the "Java Application" project.
-
Step 9: Give the project a name and click "Finish."
-
Step 10: Find the "// TODO code application goes here" line.
-
Step 11: Enter your program code on a new line.
-
Step 12: Click the "Run Project" button.
-
Step 13: Check the Output tab to see your project in action.
-
Step 14: Fix any errors.
-
Step 15: Continue learning Java.
Detailed Guide
Open your web browser and visit oracle.com/downloads/index.html.
Once you're on the Downloads page, you'll need to navigate to the installer files:
Click the "Java" option.
Click "Java SE." Click the "Download" button next to "JDK 8 with NetBeans." Select "Accept License Agreement" and then click the download link for "Mac OS X" in the top section.
This is the most recent release of the Java SDK with the NetBeans development environment. , The installer is in .dmg format.
Double-clicking it will open the installation interface. , You'll be asked to enter your administrator password before installation can proceed. , This will help you save on disk space, since you don't need it after the JDK has been installed., This is the development environment for Java, and will allow you to easily write and compile code. , This will start a new project in NetBeans. , This will set NetBeans to create Java files for this project. , For this example, call it "HelloWorld." This will open the code editor after the project is created. , Your program code will go underneath this line. , Press ⏎ Return after the "// TODO code application goes here" line to create a new line with the same indentation.
Type the following code:
System.out.println("Hello World!")
This looks like a green Play button, and can be found in the toolbar. , This frame will appear at the bottom of your screen after running the project. , If the project doesn't have any errors, you'll see "Hello World!" and "BUILD SUCCESSFUL" in the Output tab.
If there are errors, you'll see which lines they occur on so that you can go back and fix them., Now that you have the JDK installed and working, you can continue learning to program in Java.
See Write Your First Program in Java for more beginner guides.
About the Author
Samantha Ford
Experienced content creator specializing in practical skills guides and tutorials.
Rate This Guide
How helpful was this guide? Click to rate: