0% found this document useful (0 votes)
3 views5 pages

VSCode Setup C CPP Python Java

This document provides a step-by-step guide for setting up Visual Studio Code (VSCode) for programming in C, C++, Python, and Java. It includes instructions for installing VSCode, required extensions, compilers, and writing and running sample code for each language. The guide also covers setting up the Java Development Kit (JDK) and configuring environment variables for Java development.

Uploaded by

kanalfirz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views5 pages

VSCode Setup C CPP Python Java

This document provides a step-by-step guide for setting up Visual Studio Code (VSCode) for programming in C, C++, Python, and Java. It includes instructions for installing VSCode, required extensions, compilers, and writing and running sample code for each language. The guide also covers setting up the Java Development Kit (JDK) and configuring environment variables for Java development.

Uploaded by

kanalfirz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

VSCode Setup Guide for C, C++, Python, and Java

Step-by-Step VSCode Setup: C, C++, Python

[OK] STEP 1: Install VSCode

1. Go to: https://code.visualstudio.com/

2. Click "Download for Windows".

3. Install it by following the installer instructions.

4. During install, check the box: "Add to PATH (recommended)"

[OK] STEP 2: Install Required Extensions

Inside VSCode:

1. Press Ctrl + Shift + X (Extensions panel).

2. Search and install the following one by one:

For C/C++:

- C/C++ by Microsoft (Extension ID: ms-vscode.cpptools)

- Code Runner by Jun Han (Extension ID: formulahendry.code-runner) (Optional)

For Python:

- Python by Microsoft (Extension ID: ms-python.python)

- Pylance by Microsoft (Extension ID: ms-python.vscode-pylance)

[OK] STEP 3: Install Compilers

- For C/C++ (MinGW Compiler):

1. Go to: https://www.mingw-w64.org/downloads/

2. Download the SourceForge/GitHub installer for Windows.

3. Use these options: Architecture: x86_64, Threads: posix, Exception: seh

4. After install, copy the 'bin' path and add to System PATH.

How to add to PATH:


VSCode Setup Guide for C, C++, Python, and Java

- Search "Environment Variables" in Start

- Click "Environment Variables"

- Under System variables > Path > Edit > New > Paste bin path > OK

Check: Open terminal, type g++ --version

- For Python:

1. Go to: https://www.python.org/downloads/windows/

2. Download and install the latest version.

3. Check the box: "Add Python to PATH" during installation.

4. Check: Open terminal, type python --version

[OK] STEP 4: Write and Run Code

-> For C/C++:

1. Create file: hello.cpp

2. Paste:

#include <iostream>

using namespace std;

int main() {

cout << "Hello from C++!" << endl;

return 0;

3. Compile and run in terminal:

g++ hello.cpp -o hello

./hello

(Or right-click and Run Code if using Code Runner)

-> For Python:

1. Create file: hello.py


VSCode Setup Guide for C, C++, Python, and Java

2. Paste: print("Hello from Python!")

3. Run: Ctrl + F5 or right-click > Run Python File


VSCode Setup Guide for C, C++, Python, and Java

Step-by-Step Java Setup

[OK] STEP 5: Setup Java in VSCode

1. Install Java Development Kit (JDK):

- Go to: https://www.oracle.com/java/technologies/javase-downloads.html

- Download and install the latest Java SE Development Kit (JDK)

- During install, allow it to set environment variables if asked

2. Set JAVA_HOME (Optional but good practice):

- Open "Environment Variables" from Start

- Click "New" under System variables

- Variable name: JAVA_HOME

- Variable value: path to your JDK folder (e.g., C:\Program Files\Java\jdk-XX)

- Then edit 'Path' > New > %JAVA_HOME%\bin

3. Check Installation:

- Open terminal or CMD

- Run: java --version

- Run: javac --version

4. Install Extensions in VSCode:

- Press Ctrl + Shift + X

- Search and install: "Extension Pack for Java" by Microsoft (ID: vscjava.vscode-java-pack)

This includes:

- Language Support for Java(TM)

- Debugger for Java

- Java Test Runner

- Maven/Gradle support
VSCode Setup Guide for C, C++, Python, and Java

5. Create and Run Java Program:

1. File > New File > Save as Hello.java

2. Paste the code:

public class Hello {

public static void main(String[] args) {

System.out.println("Hello from Java!");

3. Open terminal, compile and run:

javac Hello.java

java Hello

(Or click Run Code if Code Runner is installed)

[OK] Java is now ready to use in VSCode!

You might also like