Total Pageviews

Saturday, 18 June 2011

How to set a path for java?

Read all the instructions and install the .exe file present in the JDK folder.

CONFIGURING JAVA
once java is installed , we need to configure it by adding the java path to the environment variable.PATH to the java directory , we need to perform the following steps.

step 1 :
 right click on the my computer icon and select properties option from the dropdown menu.The System properties dialog box appears, as shown in the figure.









step 2:
 Select the advanced tab to display the advantage tab page, as shown in the figure.




step 3 :
 click the environment variable button to display the environment variable dialog box, as shown in  the fig .





step 4 :
 The environment variables dialog box is divided ito two section - user variable and system variable .Under the system variable section , select the Path option below the Variable coloumn and click the edit button. The edit System variable dialog box appears , as shown in the figure.





step 5 :
 By default, the Path variable is already set to multiple locations. To set the Java directory path to the Path variable, append the directory path in the variable value text box ,seperated by semi-colon, as shown in the figure.



step 6 :
 click OK to close Edit System variable dialog box.
 click OK to close Environment Variable dialog box.
 click OK to close System Properties dialog box and complete the process of configuring  java


compiling the program
To compile the program, we must run the java compiler javac , with the name of the source file on the command line .
example : javac NSEC.java
the compiler will automatically create a .class file and it contains the bytecode.
example : <classname>.class





No comments:

Post a Comment