Java Install Manual



home

How to Download and Install Java

First check if you have or don't have java.

Even if your system has Java, you want to check you have the the right version.

Start the DOS/command window (the black window thing).

How to start the DOS/command window?

Windows Vista and 7:

Left click on the start button on your tool bar. It's the multicolor four flying windows thing.

It will open a dialog box and one of the things is a field where you can search for files.

In that search box, type "cmd" short for command, without the quotation marks and hit return key.

It will open the cmd window (aka dos window) (aka the black window thing).

It is called the command window for a reason. You can type in commands.

Just for the heck of it type "date" (without quotation marks and hit return key).

It should respond with current date-time.

The above can also be explained as follows.

> The > is a called a prompt. It signifies that computer is listening to your commands. Computer prints it in the command window to tell you it is ready for you (as opposed to being busy working on something else).

It may look like > or may look differently (%, $) but it is always signifying that computer is listening.

For all commands, you always have to hit the enter key. Since it is always so, I may not even say it.

>date //means, at the prompt, type date and hit enter

>javac -version //means, at the prompt, type " javac -version" and hit enter

One of three things will happen.

(a) It prints "Command not recognized"

(b) It prints some number different from current version, which means you have old version.

(c) It prints the current version.

If you get (a) or (b) you need to install Java on your computer and follow this page.



Java SE JDK (not JRE) software can be downloaded from here

http://www.oracle.com/technetwork/java/javase/downloads/index.html

You will need to sign License Agreement.

The page contains links to install instructions.

The page contains links to Java documentation that you may want to use in more advance courses. The website has documentation of the Java API. Informally API is how you can use the classes that the nice people of Java gave us and we don't have to write them.


After the software is installed, you need to set path. Here are the instructions for some MS Windows OS.

From Julie.

***For Win 7 and Vista

1) Get the full path to the javac compiler. To find the full path do the following steps:

Click on the Start menu
Click on Computer (My Computer on Vista)
Double click the C: drive
Double click on the Program Files folder
Double click on the Java Folder
Double click on the jdk folder (it will have a name similar to jdk1.6.0_21 The numbers will vary)
Double click on the bin folder. Look for the javac compiler. It is in the bin folder your full path
will look similar to the following:

C:\Program Files\Java\jdk1.6.0_21\bin

2) Update the environment variables

Click the Start menu
Click Control Panel
Click the System Panel
Click Advanced System Settings
Click on the Environment Variables box
Highlight the Path variable in the bottom box and click edit
Don't remove anything in the Path variable box just add a semi-colon and
the path you discovered in step 1

***Windows XP and *nix and Mac OS:

Here is my view. (Same in principle for *nix Mac)

Suppose you install your SDK in <full-path-java-install-dir>.

In the <full-path-java-install-dir> find path <jdkNNN or similar>\bin

(The bin must contain file javac, if not you are in a wrong place.)

You need to set up environment for path on the computer. You can do it in two different ways.

[non-expert] Start DOS/CMD Window (the black window thing). In it you set up path. The disadvantage is that this needs to be done every time you start working with Java.

>set path=%path%;<full-path-java-install-dir>\<jdkNNN or similar>\bin

WARNING. If you think you are an expert but you are not, the following is a good way to disable your computer from doing anything useful.

[expert] If you are an expert computer person you can set environment permanently as follows: control panel - system - advanced - environment - user variables. Do this.

set path=%path%;<full-path-java-install-dir>\<jdkNNN or similar>\bin



For Mac/SUN/Linux, similar idea.

[test of install] After you configured the path using either of the two methods above, you can go and test your installation.

>echo %path%

It will show the path. Check that path includes path to Java.

Go to any other directory than your Java install dir.

>javac -version //should show your version

>java -version //should show the same version as javac shows

End of install.

To get simple manuals.

>javac

The system will respond with a manual for javac (compiler).

If system says, I can’t find javac, the path is not set properly.

>java

The system will respond with a manual for java (byte-code interpreter)

If system says, I can’t find java, the path is not set properly.

Now to really test the java and javac, do the following:

  • go to my page on this website, help1500.

  • download Simple3.java into some directory, say <d>.

  • open DOS/CMD window and do cd into <d>.

  • >javac Simple3.java

  • It should return silently.

  • To execute do this:

  • >java Simple3

  • It should say: “hello from Simple3”.

Copyright

All information on this website is copyrighted by Robert R. Silverman, 2002, ... current date. No part of this system or information presented here can be reproduced using any means, such as: book print, physical, electronic, chemical, biological, mathematical, telepathic, or other not yet discovered means without the explicit permission by Dr. Robert R. Silverman, CSU Stanislaus, rsilverman@csustan.edu An explicit permission is given to all my students to copy this material as needed for educational noncommercial purpose.