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!
2. Next step: accept the terms and install.
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!
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.
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.