Beginner’s Guide For Install JDK( Java Delvelopment Kit) And Eclipse In Windows

Before writing any java project, you need to install Java Development Kit(JDK) first. I use jdk1.7 in all my selenium webdriver example projects. So you can download jdk1.7 for learning purposes. After you download it, you can follow the below instructions to install it step by step.

1. How To Install JDK1.7 On Windows.

  1. Click here to go to the jdk1.7.0_80 download page.
  2. There list the JDKs for all platforms on the download page. Click the download link at the end of one platform that feet your needs to download it.
  3. Note, do not download JRE, just download JDK. Before you can download, you must check the Accept License Agreement checkbox.
  4. Before the JDK download process starts, if you are not login to Oracle, you need to log in first. If you do not have an Oracle account, you need to register one.
  5. Double click the downloaded JDK installer file to install the JDK1.7.0_80.
  6. In the Open File – Security Warning popup dialog, click the Run button to start the installation process.
  7. Please note the JDK installation path should not contain whitespace character, if not there may have errors when you run the java program.
  8. Keep default options unchanged and click the Next button until the installation complete.

2. How To Run Java And Set JAVA_HOME On Windows.

  1. After you install JDK1.7.0_80, you can run java.exe in the terminal window with the command C:\Java\jdk1.7.0_25\bin\java.exe.
  2. But it is not convenient to run java in this method each time, so we need to add the java bin directory in the windows Path system environment variable value.
  3. First, you need to add the JAVA_HOME system environment variable follow the below steps.
  4. Open the windows explorer, right-click My Computer and then click the Properties menu item in the popup menu list.
  5. Click the Advanced system settings menu on the Properties window left side to open system properties dialog.
  6. Click the Advanced tab in the System Properties dialog, then click the Environment Variables button to open the Environment Variables dialog.
  7. Click the New button in the Environment Variables dialog to add the JAVA_HOME system environment variable.
  8. Set variable name to JAVA_HOME, set the variable value to your JDK installed directory such as C:\Java\jdk1.7.0_80.
  9. Click the OK button to save the JAVA_HOME system environment variable.
  10. Add java bin directory in Path system environment variable.
  11. Edit Path system environment variable in Environment variables list. Add  %JAVA_HOME% \bin; at the beginning of its value. Please note separate each bin path by a semicolon.
  12. Now you can run the java command in a dos window directly as following.
    C:\Users\zhaosong>java.exe -version
    java version "1.8.0_211"
    Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
    Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)

3. How To Install Eclipse On Windows.

  1. Eclipse is a free java development IDE( integrated development environment) tool. You can use it just after download and unzip the zip file into a local directory.
  2. There have a few eclipse packages used for different coding languages. Select the one you preferred. Since we just want to develop a java project, so we can choose Eclipse IDE for Java EE Developers or Eclipse IDE for Java Developers. Choose the correct eclipse version, 32 or 64 bit which matches up to your operating system.
  3. Save the download eclipse zip file into your local PC.
  4. Unzip the downloaded eclipse zip file into a folder you preferred. Wait until the unzip process finished. You do not need to install it, just double click the file eclipse.exe inside the extracted folder to start it. You can also create a shortcut for the eclipse.exe file on your desktop, then you can run it easily.
  5. After the eclipse startup, you need to choose the workspace folder to save all your project files. I prefer to choose a custom folder as your workspace folder because it is easier to remember.
  6. Now you can see the eclipse welcome page after click OK on the above page.

4. How To Download JDK For Eclipse.

  1. There is a default JDK installed with eclipse. You can follow the below instruction to find it.
  2. Open Eclipse, click Window —> Preferences menu item on the top eclipse menu bar to open the Eclipse Preferences window.
  3. Click Java —> Installed JREs in the left panel of the popup dialog. You can see eclipse default installed JDK in the right panel. If you want to add download JDK for eclipse, just click Add button in the right panel.
  4. Choose Standard VM  in the popup Installed JRE Types list, then click the Next button.
  5. It will popup the Add JRE / JRE Definition dialog window. Click the Directory… button after the JRE home: text box to choose your download JDK ( not JRE ) home directory( for example C:\Java\jdk1.7.0_80 ).
  6. Click the Finish button then you can see the downloaded JDK for the eclipse has been added to the Installed JREs list.
  7. Check the checkbox before the JDK you just added. then click the OK button to save the changes.
  8. Now you have added the downloaded JDK in eclipse, and you can read the reference article to learn how to create your first Java project and how to fix java Unsupported Exception.

References

  1. How to create a java project with myeclipse
  2. How to fix java Unsupported major.minor version 51.0 Exception
0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x