(upbeat music)
- In order to follow along
with this course on Windows,
you'll need to install the Java Development Kit from Oracle.
Click on Java SE under Top Downloads.
Then click on Download under JDK.
In this list,
locate the version for your copy of Windows.
Windows x86 for 32 bit windows, or Windows x64
for 64 bit Windows.
And download the Installer.
I've already downloaded it to my desktop.
And our fire it up by double clicking on the installer icon.
If prompted with a User Account Control dialogue, click Yes.
If you already have a copy of Java installed,
you might see a prompt showing that it's being uninstalled.
But then you can follow along with the rest of the prompts.
I recommend accepting all default values.
Notice the location of the installation folder
under C:\Program Files\Java.
You'll then have a sub folder
that includes your version of Java and the update version.
I'll be installing Version eight, update number 45,
the most recent version
as of the time of this recording
It'll take a few minutes to copy everything
over onto your computer.
You're actually doing two installations:
One for the Development Kit
and one for the Java Runtime Environment or JRE.
When the JDK installation is complete,
you'll see this prompt, and you'll see where
the JRE is being installed, and you can click Next.
And that will complete the installation process.
When the installation is complete,
close the installer window.
Next, you'll need to set a couple of environment variables
to make sure that the Java compiler
and other command line tools are accessible
no matter what kind
of Java Development Environment you're using.
Go to the Control Panel.
In the search box, type environment.
Then click on edit the system environment variables.
Click the Environment Variables button
in the lower right corner.
Next, set a new variable named JAVA_HOME.
I've already created this variable
and I'll show you what it looks like.
Notice the value
of this variable is the actual installation folder
for the JDK or the Java Development Kit.
Make sure you're spelling it exactly correctly.
This is how some development environments
will find the Java Development Kit.
You'll also need to take this value
and append it to your path variable.
I'll cancel that dialogue.
Then I'll go down here and double-click on Path.
And notice that I've added this value
to the end of the path variable,
but it's not just the installation folder.
I've appended the bin sub folder
because that's the folder
that contains the Command Line tools.
You'll add value to the end, separated
from the previous string with a semi-colon character.
After you've done all that, close these dialogues
and then go to a Command Prompt.
Then at the Command Prompt, type java -version.
That tests the Runtime Environment or JRE.
And I see that I can reach the Java Runtime Environment
and it shows me the current version.
Then to test the JDK location, type javac,
that's the compiler tool.
And once again, append -version.
And you should see this output indicating the version
of the Java compiler.
If both of these tests work,
you've successfully installed Java
and set up your environment variables
so that you can run the Java tools from the Command Line
or from any Java development environment.
The default installation of Mac OS X does not include Java.
You need to download it and install it.
To find out whether you have Java on your computer,
go to terminal and type, java -version.
On my computer, I have Java six.
It reads as 1.6.0.0_65.
On your computer,
if you don't have Java installed at all,
you might be prompted to go to a page on the Apple website.
But for the purposes of this course,
I want to use Java eight, the most recent version of Java
as of the time of this recording.
So whether you already have Java installed version six
or you don't have Java at all,
you'll want to go to the Oracle website.
And from there, click on Java SE under Top Downloads.
Click download under JDK.
And then you'll need to accept the License Agreement
and download Java for Mac OS X.
There's only a 64 bit version.
Older Macs with 32 bit processors aren't supported.
I've already downloaded the installer to my desktop.
And I'll open it by double clicking on the DMG file.
I'm using Update 45 of Java eight.
Then I'll double click to start the installer package,
and click through the prompts to complete the installation.
It'll take a few moments to copy everything over into place.
Once the installation is complete, you can close it.
Then go back to your Terminal window,
and try typing java -version again.
And this time you should see version eight.
It reads as 1.8 and then the update version at the end.
Also, confirm that you can get to the Java compiler.
Type, javac -version.
And you should see an output showing the version
of the compiler.
If you see 1.8 and then an update version
for both Java and javac,
then you're ready to use on Mac OS X.
It's also worth knowing where Java is installed.
I'll go to a Finder window,
and I'll select \Library\Java.
Under there, I'll go
to the JavaVirtualMachines sub folder.
And there's my new Java eight installation folder.
It contains a folder named Contents,
which has a folder named Home.
And that's where the JDK is actually installed.
The bin folder contains all of the command line tools,
including java, javac, javadoc, and others.
Once you know where everything is stored,
you can then effectively set up
your integrated development environment
such as Eclipse or IntelliJ IDEA.
(upbeat music)