Showing posts with label tools. Show all posts
Showing posts with label tools. Show all posts

Monday, July 29, 2013

Installing the Java Software Development Kit (JDK)

The first software package that you need to install for creating Java EE applications is the JDK, which enables you to compile Java source files into binary class files. In addition to the Java compiler, the JDK includes the Java Runtime Environment (JRE), which provides a Java virtual machine that application servers can run on.

The following steps describe how to install the JDK on your development machine. (We will use a Windows 7 machine in these examples; the procedure may be slightly different for other platforms.)
  1. Go to the Oracle Java Downloads page.
  2. Click on Download Java Platform (JDK).
  3. Accept the license agreement.
  4. Choose your platform and download the installer.
  5. Follow the installation wizard and wait for the installation to complete.
Click on Java Platform (JDK)

When the installation completes, follow these steps to set the JAVA_HOME environment variable:
  1. On the Desktop, right-click on Computer, then select Properties.
  2. Click on Advanced System Settings.
  3. If JAVA_HOME is not listed under User variables, click New
  4. In the Variable Name field, type JAVA_HOME. 
  5. In the Variable Value field, type the installation directory of the JDK; for example: C:\Program Files\Java\jdk1.7.0_25
  6. Then click OK.
The Environment Variables window

Setting the JAVA_HOME environment variable

Now follow these steps to add the JDK bin/ directory to your PATH environment variable:

  1. In the Environment Variables window, select Path under System Variables and click Edit.
  2. In the Edit System Variable window, add the bin/ directory of the JDK installation to the Path variable; for example: C:\Program Files\Java\jdk1.7.0_25\bin
  3. Click OK on the Edit System Variable window.
  4. Click OK on the Environment Variables window.
  5. Click OK on the System Properties window.

Setting the Path environment variable

To test that you have set the environment variables correctly, open a new terminal or command prompt window and type the following commands:

>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.7.0_25
>javac -version
javac 1.7.0_25

Your output shoud be similar to the output shown above.

Sunday, July 28, 2013

Set up your environment to create Java EE applications

You need the following tools to develop and test Java EE applications:

  • The Java Software Development Kit (SDK). The SDK is required to compile any Java program, including classes to be included in Java EE applications.
  • A Java EE application server. The application server installed in your development machine helps you test and debug your applications during the development phase.
  • An Integrated Development Environment (IDE). An IDE helps you create and manage Java EE applications as projects. The sophisticated editors provided by most IDEs increase your productivity and enable you to detect errors earlier in the development phase.
  • An IDE plugin for your application server. Some IDE plugins enable you to start and stop the server from the IDE and to view the server log on the IDE window.

In future posts we will describe in detail how to install and use the Oracle Java SDK, the GlassFish application server, and the NetBeans IDE.