Sei sulla pagina 1di 22

Running Java Program from Command Line

Type the program in notepad


File name should be same as class name
Rename file extension from .txt to .java

www.EngineersTutor.com 1
Setting Environment variable

Right click on This PC icon on the desktop


Go to Advanced system settings
Go to Advanced tab
Click Environment variables
Under system variables, highlight Path
Now click Edit button
Place semicolon & copy, paste the path where Java (jdk) is
installed [till bin]
 For example: C:\Program Files (x86)\Java\jdk1.6.0\bin

www.EngineersTutor.com 2
www.EngineersTutor.com 3
www.EngineersTutor.com 4
www.EngineersTutor.com 5
www.EngineersTutor.com 6
www.EngineersTutor.com 7
www.EngineersTutor.com 8
www.EngineersTutor.com 9
www.EngineersTutor.com 10
www.EngineersTutor.com 11
www.EngineersTutor.com 12
www.EngineersTutor.com 13
www.EngineersTutor.com 14
www.EngineersTutor.com 15
www.EngineersTutor.com 16
www.EngineersTutor.com 17
www.EngineersTutor.com 18
www.EngineersTutor.com 19
www.EngineersTutor.com 20
www.EngineersTutor.com 21
www.EngineersTutor.com 22

Potrebbero piacerti anche