Categories: javaLearn java

How to set path in Java language

How to set path in Java language

To Windows

After you’ve installed the Java Development Kit(JDK) in Windows, you must set the path in Java Environment variable to point out  the JDK installation directory.

Default drive is Programming file in C Drive.

If you save the java source file inside the JDK/bin folder, this path is not required. Otherwise, if you save java source file in any other directory or folder(out side of the JDK/bin folder), it is required to set path to compile and run the java program.

 

Methods to set Java  path

There are 2 methods to set java  path

  1. temporary method
  2. permanent method

How to create a temporary path of JDK in windows

  • Open command prompt – cmd
  • copy the path of JDK/bin directory in C drive/program file
  • Write in command prompt

set psth= C:Program FilesJavajdk1.8.0_45bin

How to create a permanent path of JDK in windows


if you like setting the permanent path of JDK, you must consider the following steps

1. Open my computer, click right mouse button and select  properties

My computer

 


2. Click on Advanced system setting

System setting

Click on  Environment Variable

System properties

Click the new button in the user variable

Environment variable

Write path in Variable name

System properties

Copy the path or Address of JDK bin folder

bin

Paste path of bin folder in Variable value then click ok button

Path setting

Then click on ok button

Environment variable

Then click OK button

System properties

Ok you set permanent path of Java for the run and compile on your PC

Related post

Java Hello world

Java introduction

How to download java on Windows

Karmehavannan

Recent Posts

Multiply two numbers in Java using scanner| 5 different ways

Multiply two numbers in Java using scanner| 5 different ways In this article, we will…

3 months ago

5 different ways to Divide two numbers in Java using scanner

5 Different ways to Divide two numbers in Java using scanner In this article, we…

3 months ago

Learn 8 Ways to Subtract Two Numbers Using Methods in Java

Learn 8 Ways to Subtract Two Numbers Using Methods in Java In this article, we…

4 months ago

10 ways to subtract two numbers in Java

10 ways to subtract two numbers in Java In this article, we will discuss the…

4 months ago

Java Code Examples – Multiply Two Numbers in 5 Easy Ways

Java Code Examples – Multiply Two Numbers in 5 Easy Ways In this article, we…

4 months ago

How to Divide two numbers in Java| 5 different ways

How to Divide two numbers in Java| 5 different ways In this article, we will…

4 months ago

This website uses cookies.