Go Back

Setting up VS Code for Java development

Setting up VS Code for Java development

How to develop and run a Hello World program in Java using Visual Studio Code is explained in this lesson.

To quickly start I would suggest you get vsCode installed through this link if you don’t already have it.

 

Coding Pack for JAVA

Instead of installing Vscode from scratch, you can use the Coding Pack for Java, which includes VS Code, JDK, and other necessary Java extensions.

-for windows:windows

-for mac:mac

 

 

Extension for JAVA

If you didn’t install the coding pack for java and you already have vsCode installed, click this link to download the extension needed to run java all at once or navigate to the Extension store (Shft + cmd + X) on mac (Ctrl+Shift+X) on windows in vsCode and install the following extension manually

 

-Language Support for Java™ by Red Hat

-Debugger for Java

-Test Runner for Java

-Maven for Java

-Project Manager for Java

-Visual Studio IntelliCode

 

Installing and setting up JAVA Development Kit (JDK)

To use Java within Visual Studio Code, you need to install a (JDK) on your local environment.Installing a JDK for the first time? Here are some suggestions about where to get one:

 

-Amazon Corretto

-Azul Zulu

-Eclipse Adoptium's Temurin

-Microsoft Build of OpenJDK

-Oracle Java SE

-Red Hat build of OpenJDK

-SapMachine

 

Creating a java file

Once you have vsCode installed, follow the following steps

1.open up vscode and click cmd+N on mac or ctrl + N on window,

2.click cmd+S on mac or ctrl + S on window, When prompted, save your file with a name you want and the extension ".java" appended to the end of the filename, then set the location you want your file to be and click Enter.

And there you have it 💥 🎉, Your java file.

To create a Java project, check out my article on how to create a java project