SET AS HOME PAGE

ADD TO FAVORITES / BOOKMARK THIS WEBSITE (More Details)

Introduction

Servlet

Jsp

Security

Enterprise Beans

Contact Us


Configuring Java with the System

 Introduction

Java is an object-oriented programming language with a built-in application programming interface (API) that can handle graphics and user interfaces and that can be used to create applications or applets. Because of its rich set of API's, similar to Macintosh and Windows, and its platform independence, Java can also be thought of as a platform in itself. Java also has standard libraries for doing mathematics.

Much of the syntax of Java is the same as C and C++. One major difference is that Java does not have pointers. However, the biggest difference is that you must write object oriented code in Java. Procedural pieces of code can only be embedded in objects. In the following we assume that the reader has some familiarity with a programming language. In particular, some familiarity with the syntax of C/C++ is useful.

In Java we distinguish between applications, which are programs that perform the same functions as those written in other programming languages, and applets, which are programs that can be embedded in a Web page and accessed over the Internet. Our initial focus will be on writing applications. When a program is compiled, a byte code is produced that can be read and executed by any platform that can run Java.

You need to download Jdk or j2sdk and instal it in your system. Next you need to set the JDK path as explained below topic (Clear Details about how to Set the JDK path)


 Introduction To Handle JDK Versions

To make programs compatible on both JDK 1.2 and JDK 1.3

In the Environment Variables dialog box, select Path in the System variable and click Edit. Append to the existing path, the path to the bin directory of J2sdk. For example, if the Path variable contains value as:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem; C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\MySQL\MySQL Server 4.1\bin You need to append the path to the bin directory of J2SDK 1.4.2 as :

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem; C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\MySQL\MySQL Server 4.1\bin;C:/ JDK 1.3/bin

Click OK button of the dialog boxes to close them.

When you compile and execute Java files the compiler and JVM of JDK 1.3 will be used. If you need to compile and execute Java files with a different version of installed J2SDK, such as JDK 1.2 you will need to edit the JAVA_HOME and PATH variables that you had set in the Environment Variables dialog box to point to the new locations.

Alternatively, you can also set the JAVA_HOME and PATH variables through command prompt. The commands are:

SET JAVA_HOME=C:/jdk1.2
SET PATH=C:/jdk1.2/bin

If you compile and execute Java files using the command prompt, it will now use JDK1.2 instead of JDK 1.3. However this holds true only for the particular command prompt window in which you have set JAVA_HOME and PATH.

 Clear Details about how to Set the JDK path

  1. Right click on My Computer and click the Property


    (or)


    Go to Start->Control Panel (optional).

    Now click Performance and Maintenance (optional).

    Now click the System (optional)
  2. Here, select the Advanced tab
  3. Now click the Environment Variable button
  4. Now type PATH in the Variable name field and C:\Program Files\Java\jdk1.5.0_05\bin(i.e. path of the jdk where instaled in the system) in the Variable value field
  5. Now click the OK button
  6. Now click the OK button
  7. Now click the OK button


 Click for Next Topic
<- PREVIOUSNEXT ->