Friday, 25 February 2011

setting class path

Before writing your first java program you need to set class path.
to set the class we have two methods.
  1.  Temporary method:In this method first open the command prompt by typing cmd in run.
       Type the following code: 
      c:\>set path="%path%".;C:\Program Files\Java\jdk1.6.0_11\bin;
                                         
                 in the above statement set means it sets the path and dot(.) tells that sets the path to current directory which is specified the path and is the path where the java software is installed in your system.
        But using this method need to set class path at every time when you open new session or command prompt. 

  2.Permanent method(Default method):In this method we sets class path permanently need to set every time when you open the command prompt.to set the path follow bellow steps
step 1:Right click on my computer and select and open properties.
2.After opening window select advance menu
3.click the Environment variables 
4. select new user variable
5.After opening popup window enter variable name as "path" and
    variable path as your java installation path till to bin folder 
 6. your class paths visible  in your user variable category  
 
  

No comments:

Post a Comment