- HubPages»
- Technology»
- Computers & Software»
- Computer Science & Programming»
- Computer Programming Tutorials
How To Run A Java Program In Command Prompt Windows 10
Welcome to the world of programming new programmers and hub readers. To make some ground I am starting with ‘C’ language which changed the world of programming altogether. Before ‘C’ , many language has come, but the acceptance and popularity that ‘C’ has got is unimaginable.
C Programming Language Importance
It was invented by Dennis Richie in Bell Laboratory. Although many languages come after ‘C’ but ‘C’ is still used by number of companies and programmer. As the complexity of programming increased, C++ came with its object oriented programming feature. Object oriented programming means to see the all real world things like car, dog etc in terms of object.
As 1990 came, due to internet revolution C++ seems limited to the programmer because it can’t be used for website development. This has set the stage for JAVA.
Java Programming Language Origin
JAVA is first invented in 1991 by groups of programmer like Patrick naughton, Ed frank, Jonathan Payne. Later many people contributed to the development of language .JAVA is the first full object oriented programming language. JAVA is the programming language that is used in any platform whether it is window or Linux or Lion os x.
It is the programming language that is used in website programming, embedded programming and in mobile programming also. Android mobile operating system which is almost used in all the mobiles today, is based on the java platform. After that net. came from Microsoft which followed java object oriented feature.
Presently java and .net is the most popular programming language.Other software like PHP,Ruby on rail,joomla language are also there which are invented in later part of 2000.
In this tutorial, we are running program in Microsoft latest operating system window 10.For new users in Java world, first java program is very important. Here is the HelloWorld Java program for beginners.
1. First write this program in your notepad.
Writing Java Program In Notepad
class HelloWorld { public static void main(String args[]) { System.out.println("Hello World java"); }//end of main }
Java Program Detail
Now any program in JAVA starts with class. After class, There is name of class. public is specifier and static is used to run program right out of box. Void keyword is used as we are not returning anything from main function. String args is argument for the function main.
Buy Java the Complete Reference From Amazon
2. Oracle company provides you with java toolkit named JDK 8.This toolkit contain all the jar files. Jar files is collection of 2 or more java programs. When these programs are bundled together, they are called jar files.
These are jar files are required for compiling and running any java program.It also contain the file called Javac and Java exe for compiling and running the program respectively.
Although there are number of book to learn java in the market,but for beginners the best book for learning java is "Java the complete refrence".All over the world ,it is most read book for java beginners.
Download Java Development Kit
- Java SE Development Kit 8 - Downloads
Download JDK 8, a development environment for building applications and components using the Java programming language.
3. First of all, we will compile this java program. So save your this program in C drive in folder named Test. Save this program with the name of class HelloWorld. So the file name will be HelloWorld.java c:\\First\Helloword.java.
4. Open your cmd(command prompt)window by typing in window 10 search box.
5.When it will open .Type c:>cd Test in cmd window
Compiling The Java Program
6. Now type set path after First command like this c:\Test> set path=C:\Program Files (x86)\Java\jdk1.8.0_51\bin.;.Using set path we are pointing toward javac compiler which will compile our java program.By we don't have to change system properties.
7.Now type like this in cmd c:\Test>javac HelloWorld.java and press enter.Programme will be compiled.
Running The Program
8.After compilation .The file generated will be HelloWorld.class file which contain unrecognizable with 0,1 combination.It is called bytecode in java language.
Now type in like this in cmd window
c:\Test>java Helloworld
9. After compilation and running the java program,our program will give the following output.
Here a video where you can see that how java program is run in window 7 and 8 operating system.Steps are same as in window 10 OS.
So now you learned that how to run java program in command window of Window 10 OS.Practice more to run every java program in this way. After that, you can shift to some good Java editor like eclipse or JBuilder where it is easy to write, compile and run the program. Happy programming to all.