Compiling and Running Java program from command line

This tutorial teaches you Compiling and Running Java program from command line.



What are the benefits of learning Java Programming? A brief history and future of Java programming language Importance of Java for Mobile Application Development How To Become A Good Software Developer? Learn Java Programming for beginners 5 Reasons Java is Still a Great Language to Boost Your Career Prospect as a Programmer How to learn Java with no programming experience? How to learn Java? What are Classes and Interfaces in Java? Converting a String to Integer in Java How to check if a string exists in a string in JavaScript? Installing JDK 8 on Windows 10 and configuring the settings Video Tutorial of reading file in Java 9 Invincible Reasons to learn Java New to Java programming Java Programming Tips, Articles and Notes How to download JDK 1.6? Encapsulation in Java Programming How to format number in Java? Generics Example Program in Java Java 9 Features Java 9 Tutorial, news and examples How to read content of JPEG file in Java? Image Processing Tutorials in Java Programming Language Introduction to Java Technology Java 8 Consumer Interface with forEach Loop Introduction to Generics in Java Java 8 consumer class(interface) example Oracle Launches Project Valhalla for Java How to read properties file in Java? How to add JDK 8 support in Eclipse? Java 8: Java 8 is officially released and it can be downloaded How to Invoke method using Reflection API of Java? First Lambda Expressions in Java Java 8 expected release date Lambda Expressions example in Eclipse JDK 8 Release Candidates Available Lambda Calculus Lambda Expression in Java 8 How to learn Java easily? Java made easy Oracle to release Java 8 in March 2014 Object Oriented Programming in Java Java Training Free Java beginners Course Easiest way to learn Java Tutorials on Java JDK 8 - Developer Preview Released Step by Step Java tutorials for beginners Learn the Java 8 and master the new features of JDK 8

Compiling and Running Java program from command line - Video tutorial that explains you all steps necessary to compile and run the Java program from dos prompt on windows computer.

In this tutorial I will teach you the process of compiling and running java program from command line. We have also video instruction which makes learning of Java very easy.

In this example we have a simple hello world Java program which simply prints the "Hello World" message on the console.

I have chosen this simple program just to explain you the process of compiling and running the Java program from command prompt. There are many IDEs such as Eclipse, NetBeans etc. which can be used to compile and run the example from the IDE itself.

For a beginner programmer it is necessary to understand the complete process of Java program compilation and execution.

A Java program is first written is any text editor such as notepad and then saved as .java extension. In this example our program name is "". Code of the Java program is:


public class HelloWorld{
	public static void main(String [] args){
		System.out.println("Hello World!");


To compile the program following command is used:


To execute the program following command is used:

java HelloWorld

Here is video tutorial of the Compiling and Running Java program from command line:

View more tutorials on Java


Share on Google+Share on Google+

Compiling and Running Java program from command line

Posted on: March 11, 2013 If you enjoyed this post then why not add us on Google+? Add us to your Circles



Discuss: Compiling and Running Java program from command line  

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
Mehak Mirza
December 16, 2013
have problem in using java compiler jdk.

i have install java compiler jdk but i dont know how to use it. i'm a beginer . i just know C++ programming language. i wanna become a progammer of java.. kindly get me...