Java/How to Setup Java on your PC

From Meshplex

Jump to: navigation, search
Image:Java_programming.jpg
Introduction to Java
Overview of Java
How to Setup Java on your PC
Data Types, Variables,and Arrays
Operators
Packages, Classes, and Interfaces
Java Program
Modifiers
Control Statements
Exception Handling
Object Oriented Programming
Wrappers
Strings
Math
Arrays
Random Numbers
Date and Time
Regular Expressions
Java Collections
Generics
Java Thread and Multithreading
Java IO and file Handling
Java Network Programming
RMI
Image, Audio, Video
GUI
Applets
Internationalization
JDBC
Java and XML
In order to execute java programs and application one needs to install Java Runtime Environment that has all supporting tools like java compiler, java debugger, tools to execute java programs. In order to install JDK ( Java Development Toolkit) on the computer you need to download the jdk from Java Sun Microsystems
Please follow the step to dowload JDK 1.5 from Sun Microsystems for Windows platform.

1. Click here. You will find a screen like below.

Image:Java-screen-1.jpg

2. Click on the link called "Previous Releases". Then click on "J2SE 5.0 Downloads"

Image:Java-screen-2.jpg

3. Click on the link "JDK 5.0 Update 11". Image:Java-screen-3.jpg

4. Click on the radio button with label "Accept License Agreement". Then you need to click on the link that has been highlighted in the below image.

Image:Java-screen-4.jpg

5. Then it will ask you to save the file. Choose any directory location on your computer and click on "Save" button. Image:Java-screen-5.jpg

6. It will immediately start downloading.

Image:Java-screen-6.jpg

7. Once it is downloaded on your system you have to install it on your PC/laptop. Just follow the instructions given during the installation. Believe me it is not difficult to install JDK.

8. After installing JDK 1.5 you will be able to execute any java file.

9. To check whether JDK 1.5 has been installed properly on your PC/laptop create a file called test.java and and add the below code in it.

public class test {
 
  public static void main(String args[]) {
 
    System.out.println("Java is working properly on your machine");
  }
 
}

10. Open a cmd window and go to the directory location where you saved test.java. Execute the command javac test.java. javac is a tool used to compile a java file. Once it compiles a java file successfully it will automatically create a file called test.class in the same directory.

Image:Javac-test.jpg

11. Run the command java test.

Image:Java-test.jpg

Congratulations!!!, You have successfully installed java on your system.

Previous Next

Bold text

Personal tools