Previous | Home | Next |
In this section we are learn how java is installed and set path. To make and run on java program we need write a program on notepad then run a program through compiler java comipler JDK (java development kit). you have to following steps:
- Download jdk latest version from sun website (e.g Download jdk 1.7 for win 7 32 bit or 64 bit).
- Then installed JDK.
- Then check which version is installed in my system.
- First go to Command Prompt.
- Start -> Run -> Type cmd and then click ok.
- Then command Prompt write javac -version for check version of java is installed on pc(System).
- Write a java program to used following editor.
- Notepad.
- JCreator.
- NetBeans.
- Eclipse.
- To set path.If we set the path of java folder then we can run java program anywhere otherwise we have run our java programs from the bin folder of java.
- Right click on my computer -> then C drive open->then program files folder open->then java folder open->then jdk folder open->then bin folder open->click on address bar right click on the block and select copy then close my computer.
- Then right click on my computer and select properties.
- Then click on Advanced System Settings.
- Then click on Environment variables.
- Go to System Variables->and find path variables and then click on edit button and remove the block type semicolon and past then paste the path of bin folder.
- Then create a folder of any drive to save all java program in this folder (e.g click on my computer ->then click on c drive ->then right click - > crate folder and then clic ok to save all programs in this folder).
- Now you can save and run on your program any where in your system.
- Write the code on notepad
A Simple Java Program Write the program using note pad for window system or either used net bean or eclipse these are the IDE for program writing.following program is written in note pad.
public class Hello { public static void main(String[] args) { System.out.println("Hello World!"); } }
- save it class name with .java extension ( Hello.java) default save as type (.txt) and then change save as type all files.
- Write the code on notepad and save it class name with .java extension ,the default save as type (.txt) then save our program class-name.java save.with string(e.g "Hello.Java").
- Compile and run the program following steps
- My java program is save c drive new folder then compile and run the program process first open Command Prompt and then compile on program through comand prompt c:\Newfolder >javac Hello.java
- To run c:\Newfolder >java Hello
Previous | Home | Next |