How to Run Java Program using Command Prompt in Microsoft Windows
This is an article where the content that available in it is focusing on just how to run a Java program. Actually, it is possible to run java program if it is already exist in the device. The java program is a binary file with the name of ‘java.exe’. It is a file for running any java-related files. By default, Java does not generate any executable file. There is a previous step which must be carried out before any of Java program consisting of Java source code files is possible to be executed. That step is compiling the Java source code files into a jar or war packages which is platform independent.
For the Java program intended to run in a desktop-based environmnt, it will be a jar packages file. The jar itself can be executed through the Java Virtual Machine (JVM). In Microsoft Windows, it is a java.exe file. The java.exe file is the main software to execute Java applications.
Preparation
Before the actual process to run, do several preparation steps. It is for installing the JDK (Java Development Kit) in the device. Just check the article with the title ‘How to Install JDK Java Development Kit in Microsoft Windows 10’ in this link. In this article, there are several steps for installing JDK (Java Development Kit) in a device running using Microsoft Windows as its operating system.
Run java.exe Program
After successfully installing JDK (Java Development Kit), below is the process for executing ‘java’ program :
-
Run the Command Prompt as the Command Line Interface in Microsoft Windows
-
Then, after successfully run the Command Prompt, just run the java program by typing ‘java’ in the Command Prompt.
For further description and visualization, just take a look in the following video :