How To Set Path For JAVA Program

HOW TO SET PATH FOR JAVA PROGRAM

Java Program is set path for running program is divide into two categore: 
              1.Installation of JDK and 
              2.Set Path For Java Program

So First we process for installation of jdk so download jdk kit on oracle site. For java we need install Java Development Kit means JDK or Java Runtime Enviroment means JRE.Jdk is contains JRE+development tools.now first download JDK Tools on java mother site is www.oracle.comwww.oracle.com/technetwork/java/index.html.
First step is install jdk kit its is all process make it default click next and next process.

after this goto C drive in Program File>Java>jdk1.8.0_181.

Go to address bar select path with "bin" copy and goto desktop and right click on "My computer" click on Properties  in properties goto Advance system settings on left side. 


Next show System properties pop up open in this menu show "Advanced" options contain "Enviroment Variables".. 
Open Enviroment variables after this show USE  variables for "PC Names".


 select new for create path if path is already available go for Edit option copy "C:\Program Files\Java\jdk1.8.0_181\bin; " this path is same as all pc setting but  only JDK1.8.0_xx is different because its indicate JDK version. then ok and apply all.


Now type simple java program code on notepad. before show code of java remember java file alwasy saves as filename  and sames class name of java program example: if our class name is class "Helloworld" so save file with name "Helloworld.java"

Coding of java program Helloworld.

class Helloworld
{
             public static void main (String args[])
          {
            System.out.println ("This My First Java Program");
          }
}

Now for above code File name is Helloworld.java and Java class name is Helloworld.
Take care of Save file location is not matter but when you run program go to save file directory and then run java program.

Means my program is save in "D" drive. so go to D directory after run program show in below image:

if files does not save as correct location or you type wrong dir location for run program its arise error is: JAVAC: File Could Not Found:Helloworld.java.





Comments

Popular posts from this blog

Sample way to install wamp sever on window 10