Important Java Concept

How to Install Java in Visual Studio Code | Windows & Mac Tutorial

This tutorial will show how to install and set up Java in Visual Studio Code (VS Code) on both Windows and Mac machines. So let’s get started!

Note: The video version of this tutorial is available here! If you prefer to watch rather than read, click here!

Installing the Coding Pack for Java

If you already have VS Code or Java installed, or if you have neither installed, in any case, you must install the Coding Pack for Java.

1. Go to the Microsoft download page and begin the download!

Installing Java in VS Code Step 1


2. Next step: accept the terms and install.

Installing Java in VS Code Step 2

Creating a New Java Project in VS Code

Once installation is done, open VS Code. In the top-left corner, you will see a button (see the screenshot below).
When you click on it, a menu appears at the bottom of the screen. Go to the “Create Java Project” option in this menu.

Give your project a name and click “Create”. 
To start your project, select the folder for your files, and you’ll be on your way!

Installing Java in VS Code Step 3

Running Your Java Project

This will generate a project structure for you, with a default “app.java” file inside a “src” folder.
Now, open app.java and click on the “Run Java” button in the top right corner of the screen.

If everything is set up correctly, the program should output “Hello, world” or your specified message.

Congratulations! You did it.

Installing Java in VS Code Step 4

Additional Resources

Watch a video version of this tutorial here!

If you have any questions or require additional information, please feel free to schedule a session with one of our professional instructors for live instruction here. We hope you found the tutorial informative and beneficial.

Do you want

Java Tutor?

Aniket Malik

Aniket Malik

ORACLE CERTIFIED JAVA TUTOR

🟢 Oracle Certified Java Expert

🟢 300 + ⭐ ⭐ ⭐ ⭐ ⭐

🟢 B.tech & M.tech in CSE

🟢 6+ Years of Teaching Experience

🟢 Worked as SE in Virtusa and Digidez

Do you want

Java Tutor?