
How to set a path of Java using the Command prompt (CMD)?
- Post by: svgaikwad
- June 29, 2021
- No Comment
How to set a path of Java using the Command prompt (CMD)?
If you are using Notepad or any other text editor for java programming, you should know how to set up the Java path in the command prompt.
Following are the steps.
Step 1: Open command prompt (CMD)
Step 2: Switch to your program directory using CD command
Step 3: Set PATH of Java compiler
Step 4: Use javac filename.java command to compiler the program
Step 5: Use java filename command to run the program
Blog Post
Quick guide.
Step 1:
Run Open RUN-> CMD -> OK
Step 2: Switch to your program directory using CD command
Step 3: Set PATH of Java compiler
Java Program: Hello.java
Code:
// Write a program to display message in java
public class Hello{
public static void main(String[] arg){
System.out.println(“Hello World”);
}
}
Output:
Hello World
Step 4: Use javac filename.java command to compiler the program
Step 5: Use java filename command to run the program