The Java Development Kit (JDK)
I f your system has an up-to-date JDK installed, you won’t need to install it again. The JDK provides tools, such as the Java compil...
https://willywick.blogspot.com/2015/03/the-java-development-kit-jdk.html
f your system has an up-to-date JDK installed, you won’t need to install it again. The
JDK provides tools, such as the Java compiler, used by IDEs and SDKs for developing
Java programs. The JDK also contains a Java Runtime Environment (JRE), which enables
Java programs, such as Eclipse, to run on your system.
If you are using a Macintosh running a version of Mac OS X supported by the Android
SDK, the JDK is already installed.
If you are using Ubuntu Linux, you can install the JDK using the package manager,
through the following command:
sudo apt-get install sun-java6-jdk
If this command reports that the JDK package is not available, you may
need to enable the “partner” repositories using the Synaptic Package
Manager utility in the System→Administration menu. The “partner” repositories
are listed on the Other Software tab after you choose Settings→
Repositories.
This is one of the very few places in this chapter where you will see a version number,
and it appears here only because it can’t be avoided. The version number of the JDK is
in the package name. But, as with all other software mentioned in this chapter, you
should refer to up-to-date online documentation to determine the version you will need.
If you are a Windows user, or you need to install the JDK from Oracle’s site for some
other reason, you can find the JDK at http://www.oracle.com/technetwork/java/javase/
downloads/index.html.
The Downloads page will automatically detect your system and offer to download the
correct version. The installer you download is an executable file. Run the executable
installer file to install the JDK.
To confirm that the JDK is installed correctly, issue this command from the command
line (Terminal on Linux and Mac; Command Prompt on Windows):
javac -version
If the javac command is not in your PATH, you may need to add the
bin directory in the JDK to your path manually.
It should display the version number corresponding to the version of the JDK you
installed. If you installed revision 20 of the Java 6 JDK, the command would display:
javac 1.6.0_20
Depending on the current version of the JDK available when you read this, version
numbers may differ from what you see here.
If it is unclear which JRE you are running, or if you think you have the
wrong JRE running on a Debian-derived Linux system, such as Ubuntu,
you can use the following command to display the available JREs and
select the right one:
sudo update-alternatives --config java