Sunday, May 28, 2017

Introduction to Java programming, Part-1 (3)

Setting up your Java development environment


In this segment, you'll download and introduce the JDK and the present arrival of the Eclipse IDE, and you'll set up your Eclipse improvement condition. 

In the event that you as of now have the JDK and Eclipse IDE introduced, you might need to skip to the "Beginning with Eclipse" area or to the one from that point forward, "Question arranged programming ideas."

Your development environment

The JDK incorporates an arrangement of summon line instruments for assembling and running your Java code, including an entire duplicate of the JRE. In spite of the fact that you can utilize these devices to build up your applications, most engineers welcome the extra usefulness, errand administration, and visual interface of an IDE. 

Shroud is a prominent open source IDE for Java advancement. Overshadow handles fundamental errands, for example, code accumulation and investigating, with the goal that you can concentrate on composing and testing code. Likewise, you can utilize Eclipse to sort out source code documents into ventures, arrange and test those activities, and store extend records in any number of source archives. You require an introduced JDK to utilize Eclipse for Java advancement. In the event that you download one of the Eclipse groups, it will accompany the JDK as of now.

Install the JDK

Follow these steps to download and install the JDK:
  1. Browse to Java SE Downloads and click the Java Platform (JDK) box to display the download page for the latest version of the JDK.
  2. Agree to the license terms for the version you want to download.
  3. Choose the download that matches your operating system and chip architecture.

Windows

  1. Save the file to your hard drive when prompted.
  2. When the download is complete, run the install program. Install the JDK to your hard drive in an easy-to-remember location such as C:\home\Java\jdk1.8.0_92. (As in this example, it's a good idea to encode the update number in the name of the install directory that you choose.)
OS X
    1. When the download is complete, double-click it to mount it.
    2. Run the install program. You do not get to choose where the JDK is installed. You can run /usr/libexec/java_home -1.8 to see the location of JDK 8 on your Mac. The path that's displayed is similar to /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home.
    See JDK 8 and JRE 8 Installation for more information, including instructions for installing on Solaris or Linux.
    You now have a Java environment on your computer. Next, you'll install the Eclipse IDE.

Install Eclipse

To download and install Eclipse, follow these steps:
  1. Browse to the Eclipse packages downloads page.
  2. Click Eclipse IDE for Java Developers.
  3. Under Download Links on the right side, choose your platform (the site might already have sniffed out your OS type).
  4. Click the mirror you want to download from; then, save the file to your hard drive.
  5. When the download finishes, open the file and run the installation program, accepting the defaults.

Set up Eclipse

The Eclipse IDE sits atop the JDK as a useful abstraction, but it still needs to access the JDK and its various tools. Before you can use Eclipse to write Java code, you must tell it where the JDK is located.
To set up your Eclipse development environment:
  1. Launch Eclipse from your local hard disk. (In my case, the location is /Users/sperry/eclipse/java-neon.)
  2. When asked which workspace you want to open, choose the default.
  3. Close the Welcome to Eclipse window. (The welcome window is displayed each time you enter a new workspace. You can disable this behavior by deselecting the "Always show Welcome at start up" check box.)
  4. Select Preferences > Java > Installed JREs. Figure 1 shows this selection highlighted in the Eclipse setup window for the JRE.
Figure 1. Configuring the JDK that Eclipse uses

  1. Make sure that Eclipse points to the JRE that you downloaded with the JDK. If Eclipse does not automatically detect the JDK that you installed, click Add..., and in the next dialog box, click Standard VM and then click Next.
  2. Specify the JDK's home directory (such as C:\home\jdk1.8.0_92 on Windows), and then click Finish.
  3. Confirm that the JDK that you want to use is selected and click OK.
Eclipse is now set up and ready for you to create projects, and compile and run Java code. The next section familiarizes you with Eclipse.
Previous Post
Next Post

post written by:

0 coment�rios: