Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Java Compiling and Running Java program from command line

 
 

Share on Google+Share on Google+

Compiling and Running Java program from command line

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

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 "HelloWorld.java". Code of the Java program is:

import java.io.*;

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

}

To compile the program following command is used:

javac HelloWorld.java

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

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: March 11, 2013

Related Tutorials

Discuss: Compiling and Running Java program from command line  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:1
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...
DMCA.com