How To Get Started with Java Development using VS Code on Windows (2021)

preview_player
Показать описание
A quick tutorial on how to get started with Java development on Windows using Visual Studio Code. I go through all the installation and setup steps to get you ready to work on your Java projects.

If you don't already have VSCode installed, you can save yourself a lot of time by downloading the Coding Pack for Java, which contains Visual Studio Code, the Java JDK, and all the essential Java extensions for VSCode. You can find this in the link above.

If you do already have VSCode installed, that's not a problem either. The first step is to go to your extensions and find the "Java Extension Pack", and install that. Next you need to install the "Java Development Kit" if you don't already have it, which you probably don't if you haven't installed Java before.

There are two broad types of Java installation you'll hear about. There's the JRE, or "Java Runtime Environment", which allows you to run Java applications on your computer or device. And then there's the JDK, which stands for "Java Development Kit", which is what you need if you want to develop Java applications. If you install the JDK, that will include the "Java Runtime Environment", so you don't need to install both.

So we can install the JDK from VSCode now that we have the Java extensions. Open the Command Palette (either View, Command Palette, or Ctrl+Shift+P) and search for "Java: Configure Java Runtime". Now there are also different JDK implementations to choose from. I recommend you install the "AdoptOpenJDK" because this option is free and open source. If you use the Oracle JDK, you'll need to purchase a commercial license if you ever end up developing business software with it. So for most of you, just go ahead and install the latest stable OpenJDK version. If you need a specific JDK, you can of course download that JDK from its website and install it instead.

Alright, now we've got everything installed, and we just need to let VSCode know where the JDK is located. The path to it. There are two ways to do this. I recommend you set the JAVA_HOME system environment variable. This way anything you install on your computer, that wants to know where the JDK is, can get it from this value. So let me show you how to do that.

Open "File Explorer" and right-click on "This PC", or it might be "My Computer" on older versions of Windows, and select "Properties". Then in here click "Advanced system settings", and you should see a button that says "Environment Variables...". Click that, and create a "New..." system variable, either for yourself or for everyone on your computer. We're going to set the variable name to JAVA_HOME, and the value to the folder where the JDK is installed. In my case that's C:\Program Files\Java\jdk1.6.0_02.

In case I've lost you, you can see these same steps from "Java: Getting Started" in the Command Palette. You can also create a new project, instead of opening a new folder manually, by running "Java: Create Java Project", again in the Command Palette. And this will create a little more structure for you, in your project.

#Java #VSCode #Programming
Рекомендации по теме
Комментарии
Автор

Keep it up brother! your way of teaching is pure GOLD!

blazecudi
Автор

Just putting the JDK into my System Variables was enough for vscode to recognize it. Thank you a lot! This was really easy to understand and very helpful.

KingALLO
Автор

Hey! I just found your channel and subscribed, love what you're doing! Particularly, I like how clear and detailed your explanations are as well as the depth of knowledge you have surrounding the topic! Since I run a tech education channel as well, I love to see fellow Content Creators sharing, educating, and inspiring a large global audience. I wish you the best of luck on your YouTube Journey, can't wait to see you succeed!
Your content really stands out and you've obviously put so much thought into your videos! I applaud you for that and really wish you the best for the future!

Cheers, happy holidays, and keep up the great work :)

empowercode
Автор

Most underrated YouTuber ever. Very good teaching style man. You deserve so more recognition

devpatel
Автор

I am grateful for this video, helped me a lot.
Keep it up mate😃

NicolasBhabar
Автор

Thank you so much for this tutorial! Best ever!!!!

heloisamisantos
Автор

Very nice tutorial- but you should consider updating. I followed your instructions precisely and all worked until the session on installing the JRE. When I open the command palette and enter 'configure java ...' I get something very different in VScode from your video. I see a tab telling me I do not have a Java project and refresh when I do.. When I then bypass using VS code to install attempt to install OpenJDK, I am rerouted to a page that announces that I am now on 'Adoptium's website and will be installing 'Temurin for Windows x64.' I downloaded but I stopped at this point. 'Temurin appears to be connected to Eclipse. Have I been directed to a site where I don't want to be?

exxzxxe
Автор

Thanks bro! You saved me a lot of time and pain ha

ElijahScottx
Автор

Really curious for the future java videos..❤❤❤❤

abhijitbaral
Автор

great content as always and your presentation skills are improving with every video as well. waiting for more❤

rikkujoseph
Автор

Awesome video, by the way, one question. I was following your video game bot series, but I couldn't complete it entirely because for my video game, pyautogui didn't work for the mouse moves. And I tried pydirectinput and apparently it's only for Windows, any advice? I think this game uses DirectX and that may be the cause but I'm not sure. Thanks in advance! I use MacOS.

gv
Автор

Can you pleas do a Tourial how to Program a Minecraft Forge mod with Visual Studio Code ?

coolfactor
Автор

What specs should I look for in a Windows computer?

asapkode
Автор

you should learn from this guys. thats Richard Hendriks who made the App Pied Piper.

alexschneider
Автор

Hey! I’m sure you get hundreds of requests... but was wondering if you would consider doing the rs bot of any type with python. I’m learning python and would really love to learn to do that and make the script my own with an old game I used to play. Also thank you for showing me voice attack... that has been amazing

ProwlerDigital
Автор

For anyone watching in 2024, the new line for settings.json looks like this:
, "java.jdt.ls.java.home":"[FILENAME}",

Example:, "java.jdt.ls.java.home":"C:\\Program Files\\Java\\jdk-21",

LogicalBeatss
visit shbcf.ru