How to Compile and Run Java Program
In this section, we learn how to compile and run java program step by step.
Write a program on the notepad and save it with .java (for example, DemoFile.java) extension.
Open Command Prompt.
Set the directory in which the .java file is saved. In our case, the .java file is saved in C:\\demo.
Use the following command to compile the Java program. It generates a .class file in the same folder. It also shows an error if any.
Use the following command to run the Java program:
Next TopicJava Tutorial
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week