Courses/CS506/Downloads/JDK%20Installation ...

weaverchurchΛογισμικό & κατασκευή λογ/κού

15 Αυγ 2012 (πριν από 5 χρόνια και 4 μήνες)

187 εμφανίσεις

Tutorial
: Install and configure JDK (Java Development Kit)


Step 1:
-

Download latest version of
JDK

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




Step 2
:
-

Your JDK setup file is successfully downloaded.




If you ha
ve 32
-
bit
operating system
then download
this version.

Run JDK setup f
ile
,

a window will prompt.
Hi
t

next to start installation…






Hit continue to complete installation.


Installation setup may prompt you to install JavaFx. JavaFx is a tool to desigh rich GUI (Graphical User
Interface). I
f

you
want to use

it then cont
inue installation otherwise hit
cancel
.

We will use NetBeans for
GUI designin
g

in latter lectures
.


Step
3
:
-

Confirm JDK is installed sucessfully

by varifying JDK folder is available in
Program Files
.




javac

is the file that
you need
to compile Java
class files with the help of command prompt.


Now go to start menu
-
> run and execute cmd (command prompt).





Go to
bin

directory (folder) of JDK.



Close command prompt and run again. It will run with different path of directory. Like given below
s
creen shot. Now if you will run javac it will show the error given in the screen shot.

Change Directory

Go to root of current directory
hierarchy.

Run javac

This output shows java is working correctly.


If you want to compile any java class file then you have to follow the procedure (Go to bin directory
under installation folder of JDK. Type javac and give complete p
ath of the java class file. )

It is difficult to compile java class files in this way. The solution is set the path of
bin

directory.



Step 4
:
-

Go to
control panel

and run
System
.


Alternate method is right click
My Computer

and hit
properties
.




A n
ew window will prompt. Select
advance

tab and hit
environment variables
.



Another window will prompt.


Another window will prompt.


Copy the path of bin directory under JDK installation directory.


Select

Hit

Paste
copied path at end of variable value field.

Remember prefix
;

sign

before pasting the copied path
.


Now open command prompt again and run javac. You will notice now
you
are able to run java compiler
from any directory. You don’t need to go in
bin

directory for running java compiler.