by Michael Thomas
(updated 12/24/2015)
To begin to play with Java, you need to download the following files: Java JDK (Java Development Kit) aka SDK (Software Development Kit), JRE (Java Runtime Environment) and the Java API Doc's.
Know how to unzip a file.
Know how to create new directories.
Click here for help on these prerequisites
This tutorials has been tested in the following environment:
Date: 12/24/2015
OS: Win 7
JDK: Java SE 8u66 (JDK: 1.8.0_66-b18)
Download the Java Products: JDK, DOC's, and JRE
Install each of the products
Test the installs.
Terms
JDK = Java Development Kit. You install the JDK when you install the Java SE. To compile a Java program you need the JDK.
JRE = Java Runtime Environment. The JRE is required if you want to run a Java program.
Java EE vs SE.
Abbreviations:
Java EE = Java Enterprise Edition (has the SE and adds an
Application Server).
Java SE = Java Standard Edition
I suggest always installing the SE. Later you can install an Application Server if needed.
You will be downloading the JDK (Java Development Kit), JRE (Java Runtime Environment), Java Docs and optional sample/demos.
JDK SE 8u66 - Current download version as of 12/24/15 that is not a beta version.
Download: JDK
Go to: http://www.oracle.com/technetwork/java/javase/downloads/index.html
Click the "Download" tab which is next to the "Overview" tab.
Locate the section "Java Platform, Standard Edition", "Java SE 8u65/8u66".
Click the link for JDK "Download"
Go to the section: Java SE Development Kit 8u66
Select "Accept License Agreement"
Click on the download link
for the OS you have and save it to your local PC.
Example: Windows x64; 186.65 MB;
jdk-8u66-windows-x64.exe
Download: Java Documentation
Go to: http://www.oracle.com/technetwork/java/javase/downloads/index.html
Click the "Download" tab which is next to the "Overview" tab.
Go to the section: Additional Resources
Here is some notes on the
2 links:
Java SE 8 Documentation - online documentation.
You may want to bookmark this link.
Docs Installation Instructions - online JDK install
notes
Click "Download" button in right column.
Go to the section: Java SE Development Kit 8u66 Documentation
Click "Accept License Agreement"
Click the download
link
ex: jdk-8u66-docs-all.zip -
Documentation (88.07 MB)
Go to the section: JavaFX API Documentation
Click "Accept License Agreement"
Click the download
link
ex: javafx-8u66-apidocs.zip - Download
(9.68 MB)
Reference: Online Java Documentation
http://docs.oracle.com/javase/8 - Java SE 8 docs
Click "Java SE API Documentation" - Java SE 8 API docs
Click "Java Tutorials Learning Paths" - Java Tutorial
Optional Download: Demos & Samples
Go to the section: Java SE Development Kit 8u66 Demos and Samples Downloads
Select "Accept License Agreement"
Click on the download link
for the OS you have and save it to your local PC.
Example: Windows x64: 54.28
MB; jdk-8u66-windows-x64-demos.zip
Download Reference Information:
Archive Download Versions:
http://www.oracle.com/technetwork/java/archive-139210.html
- Java Archives of older versions.
My Install Notes for Older versions
Prepare PC for Installation
User's "Environment
Variables": temp & tmp (DO NOT SKIP THIS STEP!)
I've seen the "bin\javac.exe" get installed with 0
bytes. The solution is to make sure the User's
"Environment Variables" temp & tmp is set to "c:\temp"
before starting the install.
I've seen other software installs have similar issues so I
would leave it set to c:\temp.
First, make sure that the directory exists - c:\temp
Win 7: Start, Control
Panel, "System & Security", "System", "Advanced
System Settings", click "Environment Variables" then
look in the top section called "User variables for
...."
Edit and set to: c:\temp
(Note - defaults to: %USERPROFILE%\AppData\Local\Temp)
After the install, you can change the variable back if
you want.
Version Java SE 8u66
Install the Java SE
JDK (Example of Windows 64 bit install)
File: jdk-8u66-windows-x64.exe
Double click on the install file.
Welcome Screen - click "Next"
Screen: Custom Setup
WARNING:
Click "Change"
I suggest you use the following directory
structure: c:\java\jdk1.8.0_66\
Note: The default is:
C:\Program Files\Java\jdk1.8.0_66\
Reasons why:
The spaces in "Program Files" will give you headaches down the road and may be difficult to get certain applications working! (Trust me on this one!)
Also you may want to have more than one JDK installed to support different applications.
Optional notes for reference:
Development Tools (180 Meg) - JDK, JavaFX SDK, private JRE, Java Mission Controls tools suite.
Source Code (27 Meg) - source for public API of Java
Public JRE (110 Meg) - standalone JRE (for browsers & java runtime).
Click "Next"
Check that you are
installing to: c:\java\jdk1.8.0_66\
Click "Next"
Note: At the "Complete" if you click "Next Steps" you will be taken to the online docs.
Click "Close"
Note: No reboot is
required.
Environment Variables: JAVA_HOME
Add/Verify Environment Variables so other Java tools/apps can use the value.
Go to the Environment Variable add/edit screen:
For Win 7: Start, Control Panel, "System and Security", "System", "Advanced System Settings", click the tab "Advanced", Environment Variables
For Win XP Pro: Settings, Control Panel, System, Advanced tab, click on "Environment Variable" button
Set the
JAVA_HOME environment variable:
In the "System Variables" section:
Verify/Add the JAVA_HOME environment
variable:
Click "New"
Variable Name: JAVA_HOME
Variable Value: <Full path to the home
directory of your JDK install>
Ex: c:\java\jdk1.8.0_66
(Note: Other Java tools may use this
environment system variable like: Ant)
Set the PATH
environment variable:
Note: This is only needed if you want to
easily compile from the DOS prompt vs and IDE
like Eclipse.
In the "System Variables" section:
Edit the variable: Path
View the contents and add the following to the
end of the PATH
variable.
Warning, make sure there is a semicolon (;)
before and after: ;%JAVA_HOME%\bin;
Install the Java Docs
NOTE: I suggest creating
a separate directory for the Java docs.
Create the directory: C:\java\jdk1.8.0_66_docs
Extract "jdk-8u66-docs-all.zip" to "C:\java\jdk1.8.0_66_docs"
Install the Java Sample/Demos
File: jdk-6u23-docs.zip
Extract the zip file to the following into the directory you created: C:\java\jdk1.8.0_66_docs
Extract the file (make sure
the unzip program keeps the directory structure in the zip
file).
It will create a directory called "docs/etc..." with all
of the files.
Note: Extracts out to be ~260 meg
Your Finished with the Doc install.
Reboot your PC - To be on the safe side, let's reboot. Not normally necessary.
Test Java Docs - Using a
browser launch the following files: (You may want to
bookmark these.)
Offline (local) docs you installed:
C:\java\jdk1.8.0_66_docs\docs\index.html
- links to all offline docs.
C:\java\jdk1.8.0_66_docs\docs\api\index.html
- Java SE API.
Online docs:
http://docs.oracle.com/javase/8/docs
- links to all online docs.
http://docs.oracle.com/javase/8/docs/api/index.html
- online Java SE 8 API docs.
Learn how to go to a DOS prompt. (
ie: C:\> )
Windows: Click the start button, then in the run box type:
cmd.exe
Other Options:
* For Win 7: Start, Programs, Command Prompt.
* For XP, Win200, NT: Click the start button, then in the run
box type: cmd.exe
* For Win 95/98: Click the start button, then in the run box
type: command.com
Test the public JRE:
At a DOS Prompt (ie C:\>)
type: "C:\Program
Files\Java\jre1.8.0_66\bin\java.exe" -fullversion
(Warning: need the quotes ("...") because of the space
in "Program Files".)
Ex return: java full version "1.8.0_66-b18"
At a DOS Prompt (ie C:\>)
type: java -fullversion
Ex return: java full version "1.8.0_66-b18"
At a DOS Prompt (ie C:\>)
type: java -version
Ex return:
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b18,
mixed mode)
Test the JDK's private JRE:
At a DOS Prompt (ie C:\>)
type: C:\java\jdk1.8.0_66\bin\java.exe
-fullversion
Ex return: java full version "1.8.0_66-b18"
Test JDK's javac.exe (compile Java source) command:
At a DOS Prompt (ie C:\>)
type: C:\java\jdk1.8.0_66\bin\javac.exe -help
Returns help for the command.
(Note: If DOS gives the error: ... javac.exe is not a valid Win32 application, the file exists but the byte size = 0 then reinstall the JDK. I would change the Users "Environment Variables" temp & tmp to "c:\temp". Then click on the EXE again and choose the option to "Reinstall". (voice of experience!).)
Test your Environment Variable: Path
If you will be compiling Java source code from the DOS prompt then do this test. Some will only be compiling with an IDE like Eclipse.
At a DOS Prompt (ie C:\>)
type: javac.exe -help (Note: javac.exe and
not java.exe!)
Ex return: Help info for javac.exe (Java compile)
command.
(Note: If you get a error, go back up to the section
where the PATH variable is set and follow those steps.)
Test your Environment Variable: JAVA_HOME
At a DOS Prompt (ie C:\>)
type: %JAVA_HOME%\bin\javac.exe -help
Returns help for the command.
(Note: If you get a error, go back up to the section
where the JAVA_HOME variable is set and follow those
steps.)
Test the Demos/Samples
From DOS prompt or double
click from Windows explorer:
Ensemble8 Demo
C:\java\jdk1.8.0_66_docs\jdk1.8.0_66\demo\javafx_samples\Ensemble8.jar
MandelbrotSet Demo
C:\java\jdk1.8.0_66_docs\jdk1.8.0_66\demo\javafx_samples\MandelbrotSet.jar
Modena Demo
C:\java\jdk1.8.0_66_docs\jdk1.8.0_66\demo\javafx_samples\Modena.jar
Optional Notes:
java.exe - java.exe may come from several locations!
Warning: Every
time you install a JDK or JRE, the file "java.exe" is
over written (see notes below for the directory
location). Remember this when you are testing
different JRE versions.
(Ex files: java.exe, javaw.exe, javaws.exe)
Win 7:
At a DOS Prompt (ie C:\>) type:
C:\Windows\System32\java.exe
-fullversion
C:\Windows\SysWOW64\java.exe
-fullversion
Legacy Windows OSs:
"c:\winnt\java.exe" -fullversion
"c:\windows\java.exe" -fullversion
Registry key 'Software\JavaSoft\Java Runtime
Environment\CurrentVersion'
Control Panel, Add/Remove Programs, then click "Remove" for the following:
For Java 6 (1.6.xxx)
Uninstall the JDK - Example: Java(TM) SE Development Kit 6
Update 6
Uninstall the JRE - Example: Java(TM) 6 Update 6
For Java 5 (1.5.xxx)
Uninstall the JDK - Example: Java2SE Development Kit 5.0
Uninstall the JRE - Example: Java2SE Runtime Environment
Kit 5.0
Java SDK - compile code, run applications, create API's for your code, etc...
SDK - Software Development Kit. Any way you download a SDK. After installation the directory will be called "JDK1.3" etc...
JDK - Java
Development Kit - compile code, run applications,
crate API's for your code, etc...
Note: Version 1.1 was called JDK 1.1. (Next
versions were called J2SDK.)
J2SE - Java 2 Standard Edition.
J2EE - Java 2 Enterprise Edition
J2SDK vx.x - Java 2 Software Development Kit - compile & run Java programs.
J2RE vx.x - Java 2 Runtime Environment - run java programs (you can't compile).
Java API Docs - html
files you can use to guide you through the Java classes.
API - Application Interface.
JRE - Java Runtime Environment. The JRE v 1.2 and above also includes the Java Plug-In. Use the JRE to run java applications. It is the runtime part of the Java Development Kit, but without the development tools such as compilers and debuggers. This is what your users will use to run Java applications. You don't need it unless you want to test what the users will be using.
Java Plug-In: needed to run Java Applets that use Java technology (versions) in which the browsers (IE, Netscape, etc...) have not implement yet. You do not use the applet tags in this case. Use the HTMLconverter to convert the applet tag to the appropriate object tag.
Java SE 8 Online docs - (API v8)
J2SE 1.7
Java SE API Online Docs - (API
v7)
J2SE 1.6
Java SE API Online Docs - (API
v6)
Note: The JDK also contains the JRE.
JDK - jdk-6u21-windows-x64.exe - 68 MB
Docs -jdk-6u10-docs.zip - 58MB; jdk-6-doc.zip - 52.36 MB
JDK Online API docs - Java SE API Documentation - (API
v7) (API
v6)
J2SE 1.5
Note: The JDK also contains the JRE.
JDK - jdk-1_5_0-windows-i586.exe - 45Meg
Docs - jdk-1_5_0-doc.zip - 45Meg
JRE - jre-1_5_0-windows-i586.exe
Installs to:
JDK 1.3.1_01 - c:\jdk1.3.1_01
JDK 1.3.0 - All install to c:\jdk1.3
J2SE 1.4
J2SE 1.3
JDK 1.3.1 33Meg, Doc's
22Meg, JRE 5.2Meg
(ex: SDK: j2sdk-1_3_1_01-win.exe, Docs:
j2sdk-1_3_1-doc.zip, JRE: j2re-1_3_1-win.exe)
Browsers that support JDK 1.3
As of 9/6/01 None - best support is Netscape 6
J2SE 1.2.2_017 (released 12/4/98)
J2SE 1.2.2: JDK ~21M, Doc's ~18M, JRE ~5.3M (Will not work on Win NT 3.51)
2 Downloads: J2SE SDK (included JRE) & Docs
J2SE install also installs the JRE.
Default JRE path: c:\Program Files\JavaSoft\JRE\1.2
JDK Default install: C:\jdk1.2.2
Doc default install: c:\j2sdkee1.2.1\docs - (Note: Unzip in the c:\jdk1.2.2 directory)
Browsers that support JDK 1.2
As of 9/6/01 Netscape 6
JDK 1.1.8_010
Download Managers - I suggest you get a program to help in downloading large files. Even if you get knocked of the internet, it will resume again. I've downloaded a 500 meg file before. They will normal be launched from your browser.
http://www.5star-shareware.com/Internet/DownloadManagers/netzip-demon.html - Netzip Download Demon - I use this product. This product will automaticall work with HTTP downloads only, not FTP.
http://www.gozilla.com/ - go!zilla