4 easy steps to run java program through cmd

Classy Engineers
2 min readMar 12, 2021

Java is open-source software and free for all kinds of OS which includes Mac, Linux, Solaris, and Windows, etc. To download Java, you have to download JDK first. JDK is a Java Development Kit (contains JVM and JRE) that allows developers to create Java programs and is executed by JVM and run by the JRE.

Install Java and Get Ready!

Well, Java 15 is the current version of Java. But when it comes to learning, then I will suggest you choose the latest version of Java so that you will be familiar with the new updates.

  • You can choose and download the Java JDK Version according to your OS from here.
  • After the installation of JDK, you have to configure the java path in your OS from here, otherwise, you can’t run java programs on your machine.
  • To run Java programs in Windows OS, you can either code in any text editor or you can install software tools like Netbeans or Eclipse IDE, etc.

How to run java programs through cmd on your Windows machine:

CMD stands for the command prompt and it is the default command-line interpreter program available in Windows OS. With the help of some commands, we can easily run a java program. Follow the steps here to run your first java program to print “Hello Java Learners” in cmd:

  1. Open any text editor like notepad and write the java code that you want to run and save the code with your classname.java. Remember class name and filename should be the same in java and

To know more about visit us on https://classyengineers.com/4-easy-steps-to-run-java-program-through-command-prompt/

--

--

Classy Engineers

Classy Engineers is a blog, where you can find concepts related to Lifestyle and Technology. 😊 Website link: https://classyengineers.com/