How to install JDK 1.7.0 and how to set path and classpath variables

How to install JDK 1.7.0 and how to set path and classpath variables

How to Install

Java Development Kit (JDK) 1.7 or SE 7, which is freely available from Sun Microsystems (now part of Oracle), is needed for writing Java programs. 
JDK can be downloaded from the Java mother site @ http://java.sun.com 

How To Install JDK 1.7.0

JDK or JRE?
JRE (Java Runtime Environment) is needed for running Java programs. 
JDK (Java Development Kit), which includes JRE plus the development tools (such as compiler and debugger), is need for writing Java programs.
 Since you are supposed to write Java Programs, install JDK (which includes JRE).
STEP 0: Un-install Older Version of JDK/JRE 
If you have previously installed older version of JDK/JRE, un-install them.
 Run "Control Panel" ⇒ "Program and Features" ⇒ Un-install programs such as "Java SE Development Kit" and "Java SE Runtime". (If you are not sure whether you have older versions of JDK, check!)
STEP 1: Download JDK
  1. Goto Java SE download site @ http://www.oracle.com/technetwork/java/javase/downloads/index.html.
  2. Click the "Download" button under "JDK" of "Java SE 7".
  3. Choose your operating platform, e.g., Windows x86 (for 32-bit Windows OS - "jdk-7u2-windows-i586.exe" 84MB); or Windows x64 (for 64-bit Windows OS).
STEP 2: Install JDK/JRE
Run the downloaded installer, which installs both the JDK (Java Development Kit) and JRE (Java Runtime). By default, the JDK and JRE will be installed into directories "C:\Program Files\java\jdk1.7.0" and "C:\Program Files\java\jre7", respectively. 
here i am refering to  JDK installed directory as <JAVA_HOME>
After downloading  JDK 1.7.0,just click on it ,you will get like this ,as shown below
 click on run
 click next 
click next 
after this window,u will observe like this
you have installed successfully now,click finish.

Now we have to set PATH and CLASS PATH  variables  inorder to compile or execute java .
These are said to be environment variables.
click My computer ==> properties ==>advanced,       following window will be opened like this
Now click Environment Variables, here variables are divided into two sections 
User variables : whenever it is modified the corresponding language only effected.  
Ex: Class path , in this example class variables are always for .class values 
System variables : whenever it is modified not only a single language,  corresponding  all languages are  only effected. 

Ex:path, here the variable is searching for .exe files

 click new button
variable name = classpath

variable value =  C:\Program Files\Java\jdk1.7.0
one more environment variable ,we have to set for Java home directory similar to path and 
class path.
click new button


for java home
variable name = java_home

variable value =  C:\Program Files\Java\jdk1.7.0.
Now click ok for twice. 


now for system variables ,let us set path

click new
variable name = path
variable value = C:\Program Files\Java\jdk1.7.0\bin


IF U WANT TO VERIFY JAVA IS INSTALLED SUCCESSFULLY OR NOT ,JUST GO TO COMMAND PROMT,TYPE javac if u see java compiling commands like below ,then u have installed it successfully.



Comments

  1. Thanks for your blog advice ! It puts everything in one place. and screenshots made it easy... BTW a point where explanation confuses - 1) under "user variables" you wrote "whenever it is modified the corresponding language only effected. " . by "language" what is meant ? like installed language English French German language support in windows and alternate keyboard support ? or you mean something else ? i understood this section is meant for each user and affects only that user account who is using windows at that time.
    also in "system variables" the explanation reads "affects all languages only". i think the word "only " is not needed here ? because "all languages" are affected ! Very well written article -- keep it coming ! Raj

    ReplyDelete
  2. Thanks for your informative article on Java. It is most popular and reliable software development platform for creating mobile application. JAVA Training in Chennai

    ReplyDelete
  3. Thanks Admin for sharing such a useful post, I hope it’s useful to many individuals for developing their skill to get good career.
    Regards,
    ccna course in Chennai

    ReplyDelete
  4. Appreciating the persistence you put into your blog and detailed information you provide. dotnet training in bangalore
    Dotnet developer

    ReplyDelete
  5. I’d love to be a part of group where I can get advice from other experienced people that share the same interest. If you have any recommendations, please let me know. Thank you.
    nebosh course in chennai

    ReplyDelete

Post a Comment

Popular posts from this blog

What is the difference between asynchronous and synchronous execution?

Yahoo accepting requests for inactive email IDs