Back to Browse

Compile and Run Java Program in CMD by Deepak (Part 2 - Hindi)

74.0K views
Dec 28, 2017
11:28

#java #javatutorials #deepak #smartprogramming ◾◼️ Useful Notes & Courses Links◼️◾ 👉🏻 Free Notes : https://smartprogramming.in/tutorials/ 👉🏻 Free Courses : https://smartprogramming.in/free-online-courses 👉🏻 Java Programming Course + Certificate (Upto 80% off) : https://smartprogramming.in/premium-courses ◾◼️ Youtube Free Playlists ◼️◾ 👉🏻 Core Java : https://www.youtube.com/playlist?list=PLlhM4lkb2sEhfuXL-2BDrJ67WkUdQ2v9b 👉🏻 Core Java - Java SE 21 Version (2025) : https://www.youtube.com/playlist?list=PLlhM4lkb2sEjtoPRP2AfVGJWFoltwtDdx 👉🏻 Data Structures & Algorithms (DSA) : https://www.youtube.com/playlist?list=PLlhM4lkb2sEjyqHABtdVXppkbN7-SDJ_- 👉🏻 Advance Java : https://www.youtube.com/playlist?list=PLlhM4lkb2sEjVsbbZ_kiixY5CcR84IQUg 👉🏻 Spring Framework : https://www.youtube.com/playlist?list=PLlhM4lkb2sEgJDGj2zOJnp0y5A5E6li1k 👉🏻 Springboot : https://www.youtube.com/playlist?list=PLlhM4lkb2sEhcrb1-4eyDE-rXnGNVYsek 👉🏻 Git & GitHub : https://www.youtube.com/playlist?list=PLlhM4lkb2sEijMDkb-AEUO-kzDdqxMuxS 👉🏻 Python : https://www.youtube.com/playlist?list=PLlhM4lkb2sEjIWihTdQ3Z1ifaYVHAk5YC ◾◼️ Call & Whats App ◼️◾ 📞 Call : +91 62838-30308 ; +91 98887-55565 ✆ Whats App 1 : https://wa.me/916283830308 ✆ Whats App 2 : https://wa.me/919888755565 ◾◼️ Connect With Us On ◼️◾ 👉🏻 Facebook Page : https://www.facebook.com/smartprogramming.india 👉🏻 Instagram : https://www.instagram.com/smart_programming 👉🏻 Telegram : https://t.me/smart_programming_deepak 👉🏻 Whats App : https://www.whatsapp.com/channel/0029Va6n2Gs42Dckpa2T1U1i 👉🏻 Amazon Store : https://www.amazon.in/shop/smartprogramming ----------------------------------------------------------------- 🔴 https://youtube.com/playlist?list=PLlhM4lkb2sEhfuXL-2BDrJ67WkUdQ2v9b : Core Java Playlist 🔴 https://youtube.com/playlist?list=PLlhM4lkb2sEjVsbbZ_kiixY5CcR84IQUg : Advance Java Playlist 🔴 https://youtube.com/playlist?list=PLlhM4lkb2sEhdllbTIVF0rzD0coCiuHok : Android Playlist ===================================== (A small mistake, When we compile program, it gets converted into Abc.class (not Abc.java) at position 8:22, Sorry for the mistake) TOPICS COVERED IN THIS TUTORIAL : 1. COMPILE AND RUN JAVA PROGRAM 2. HOW TO SET JAVA CLASS PATH TEMPORARY AND PERMANENT ======================================================================================== 1. COMPILE AND RUN JAVA PROGRAM Following are the steps to compile and run java program : Step 1 : Open CMD Step 2 : Check whether java compiler is accessed by CMD or not, for this type "javac" and press enter key. Step 3 : If it says "javac is not recognized as an internal or external command", then we have to set path, for temporary path set type "set path= C:\Program Files\Java\jdk1.8.0_45\bin" and press enter, its my javac path, you have to provide your java classpath. But if it directly displays some definitions, then proceed to next step. Step 4 : Then open drive where the program is saved, like "d:" and press enter Step 5 : Then if program is saved in any folder, type "cd folder_name", otherwise skip this step. Step 6 : Now compile the program, "javac Abc.java" (Abc.java is java file name) Step 7 : If there is any error it will display, if not then it will create a .class file Step 8 : Now run java program, type "java Abc" (Abc is .class file name), it will display the output ---------------------------------------------------------------------------------------------------------------------------------------------------- 2. HOW TO SET JAVA CLASS PATH TEMPORARY AND PERMANENT === For Temporary Path Set : === Step 1 : Open CMD Step 2 : Type "set path= C:\Program Files\Java\jdk1.8.0_45\bin" and press enter, its my javac path, you have to provide your java classpath. Step 3 : Then you can check whether classpath is successfully set or not, for this type "javac" and enter, if it displays some definations then path is set successfully, but if it says "javac is not recoginsed as an internal or external command" then path was not set, retry again. === For Permanent Path Set : === Step 1 : Open "My Computer" Properties. Step 2 : Click "Advanced System Settings" (present on left side of screen), it will open a dialog box. Step 3 : Click "Environment Variables", it will again open a new dialog box. Step 4 : Then here we can set path, simply provide variable name as "path" and Value "C:\Program Files\Java\jdk1.8.0_45\bin". Step 5 : Open CMD and type "javac" and enter, it will display some definitions, Successfully set path permanently.

Download

1 formats

Video Formats

360pmp422.7 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Compile and Run Java Program in CMD by Deepak (Part 2 - Hindi) | NatokHD