Tuesday, November 19, 2013

Lesson 01 - Installing Java

Before starting with anything, we have to set up a java background to work with it in our PC. All you need to do is,
After downloading and installing java Let's use,

>>>Command prompt to setting up the path<<<

  1. First go to java installed folder --> jdkx.x.x_xx -->bin and copy the path
  2. Then open command prompt ([Window key+R] then type cmd)
  3. Go to the folder you expected to do your java work using cmd.
    (*See the note below)
  4. Then type, set path=%path%;your bin path copied
    eg.
    set path=%path%;C:\Program Files\Java\jdk1.5.0_09\bin

     
*Note
  • to change the drive, type the drive name: eg. D: 
  • to change the folder type cd folderName eg. cd Umesh
  • to clear the path and go back to the drive  type cd/ 



                                                                 OR
        


>>>>>>Advaced Settings<<<<<<

Windows 8
  1. Drag the Mouse pointer to the Right bottom corner of the screen
  2. Click on the Search icon and type: Control Panel
  3. Click on -> Control Panel -> System -> Advanced
  4. Click on Environment Variables, under System Variables, find PATH, and click on it.
  5. In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
  6. Close the window.
  7. Reopen Command prompt window, and run your java code.
Windows 7
  1. Select Computer from the Start menu
  2. Choose System Properties from the context menu
  3. Click Advanced system settings > Advanced tab
  4. Click on Environment Variables, under System Variables, find PATH, and click on it.
  5. In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
  6. Reopen Command prompt window, and run your java code.
Windows XP
  1. Start -> Control Panel -> System -> Advanced
  2. Click on Environment Variables, under System Variables, find PATH, and click on it.
  3. In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
  4. Close the window.
  5. Reopen Command prompt window, and run your java code.
Windows Vista
  1. Right click My Computer icon
  2. Choose Properties from the context menu
  3. Click Advanced tab (Advanced system settings link in Vista)
  4. In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
  5. Reopen Command prompt window, and run your java code.

Setting Path on Solaris and Linux
To find out if the java executable is in your PATH, execute:
% java -version

This will print the version of the java executable, if it can find it. If you get error java: Command not found. Then path is not properly set.

To find out which java executable the first one found in your PATH, execute:
% which java

Below are the steps to set the PATH permanently,
Note: We are here giving instructions for two most popular Shells on Linux and Solaris.
Please visit link below if you are using any other shells.
Path Setting Tutorial

For bash Shell:
  1. Edit the startup file (~/ .bashrc)
  2. Modify PATH variable:
    PATH="$PATH":/usr/local/jdk1.6.0/bin
  3. export PATH
  4. Save and close the file
  5. Open new Terminal window
  6. Verify the PATH is set properly
    % java -version

For C Shell (csh):
  1. Edit startup file (~/ .cshrc)
  2. Set Path
    set path="$PATH":/usr/local/jdk1.6.0/bin
  3. Save and Close the file
  4. Open new Terminal window
  5. Verify the PATH is set properly
    % java -version
 

No comments:

Post a Comment