JavaScript Tutorials - Herong's Tutorial Examples
Dr. Herong Yang, Version 2.11

Downloading and Installing J2SE 1.6.0 on Windows

This section describes how to download and install Java SE 1.6 Update 2 on Windows.

"jrunscript": A command line script shell included in the current version JDK from Sun.com. "jrunscript" supports both an interactive (read-eval-print) mode and a batch (-f option) mode of script execution. This is a scripting language independent shell. By default, JavaScript is the language used, but the -l option can be used to specify a different language.

"jrunscript" allows you to run JavaScript code in a stand alone mode with using any Web browsers. In order to try "jrunscript", you have to have a copy of JDK (Java Development Kit) installed on your machine. The latest version of JDK is JDK 6u2 (Java(TM) SE Development Kit 6 Update 2), which is also called Java SE 6 (Java Standard Edition 6). Here is what I did to download and install JDK 6u2 on my local machine.

  • Open the Java SE Download page with this URL: http://java.sun.com/javase/downloads/.
  • Click the download button next to "JDK 6u2". You will see a new page with a list of different download files of JDK 6u2.
  • Locate the "Windows Platform - Java(TM) SE Development Kit 6 Update 2" section.
  • Click the hyper link of "Windows Offline Installation (build 06), Multi-language", which links to jdk-6u2-windows-i586-p.exe with size of 65.57 MB.
  • Save jdk-6u2-windows-i586-p.exe to a temporary directory.
  • Double-click on jdk-6u2-windows-i586-p.exe to start the installation wizard.
  • The installation wizard will guide you to finish the installation.

To test the installation, open a command window to try the java command. If you are getting the following output, your installation was ok:

C:\herong>\progra~1\java\jdk1.6.0_02\bin\java -version
java version "1.6.0_02"
Java(TM) SE Runtime Environment (build 1.6.0_02-b06)
Java HotSpot(TM) Client VM (build 1.6.0_02-b06, mixed mode, 
sharing)

Sections in This Chapter

Downloading and Installing J2SE 1.6.0 on Windows

"jrunscript" - Scripting Shell Command and Options

Running JavaScript Code with 'jrunscript'

Evaluating JavaScript Code with 'jrunscript' Interactively

Running a JavaScript Code File with 'jrunscript'

Dr. Herong Yang, updated in 2008
Downloading and Installing J2SE 1.6.0 on Windows