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

Using function or method to Write temperature conversion : Fahrenheit into Celsius

Using Function or Method to Write to temperature conversion: Fahrenheit into Celsius In this article,…

11 months ago

Function or method:temperature conversion from Fahrenheit into Celsius – Entered by user

Function or method of temperature conversion from Fahrenheit into Celsius In this article, we will…

11 months ago

Write temperature conversion program: Fahrenheit into Celsius

Write temperature conversion program: from Fahrenheit to Celsius In this article, we will discuss the…

11 months ago

How to write a program to convert Fahrenheit into Celsius

How to write a program to convert Fahrenheit into Celsius In this article, we will…

11 months ago

Function/method to convert Celsius into Fahrenheit -Entered by user

Function/method to convert Celsius into Fahrenheit -Entered by user In this article, we will discuss…

11 months ago

Temperature conversion: Celsius into Fahrenheit using function or method

Temperature conversion: Celsius into Fahrenheit using a function or method In this article, we will…

11 months ago

This website uses cookies.