How to Run Java Program in Command Prompt (CMD) in Windows 10

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ส.ค. 2024
  • In this video I am going to show you How to install Java JDK 10 on Windows 10 ( with JAVA_HOME ). also we will see Steps for compiling and running a Java program using cmd on Windows 10. So let us see How to Compile and Run Java Program Using Command Prompt (CMD) in Windows 10 [2020] .
    Java installer .msi file comes with JRE 10 and JDK 10. Java JDK 10 Installation for Microsoft Windows (64-bit). JDK stands for Java SE Development Kit. JRE stands for Java Run time Environment.
    1. Download Java
    Open your web browser
    Type URL: www.oracle.com/...
    to go to Oracle download page
    Click on button “
    Accept oracle license agreement
    Find and click on the correct jdk download link right for your operating system to download
    Save the file to disk
    2. Install Java
    Double click to run the download file
    Just follow the prompt in Installer window
    ★★★Top Online Courses From ProgrammingKnowledge ★★★
    Python Programming Course ➡️ bit.ly/2vsuMaS ⚫️ bit.ly/2GOaeQB
    Java Programming Course ➡️ bit.ly/2GEfQMf ⚫️ bit.ly/2Vvjy4a
    Bash Shell Scripting Course ➡️ bit.ly/2DBVF0C ⚫️ bit.ly/2UM06vF
    Linux Command Line Tutorials ➡️ bit.ly/2IXuil0 ⚫️ bit.ly/2IXukt8
    C Programming Course ➡️ bit.ly/2GQCiD1 ⚫️ bit.ly/2ZGN6ej
    C++ Programming Course ➡️ bit.ly/2V4oEVJ ⚫️ bit.ly/2XMvqMs
    PHP Programming Course ➡️ bit.ly/2XP71WH ⚫️ bit.ly/2vs3od6
    Android Development Course ➡️ bit.ly/2UHih5H ⚫️ bit.ly/2IMhVci
    C# Programming Course ➡️ bit.ly/2Vr7HEl ⚫️ bit.ly/2W6RXTU
    JavaFx Programming Course ➡️ bit.ly/2XMvZWA ⚫️ bit.ly/2V2CoAi
    NodeJs Programming Course ➡️ bit.ly/2GPg7gA ⚫️ bit.ly/2GQYTQ2
    Jenkins Course For Developers and DevOps ➡️ bit.ly/2Wd4l4W ⚫️ bit.ly/2J1B1ug
    Scala Programming Tutorial Course ➡️ bit.ly/2PysyA4 ⚫️ bit.ly/2PCaVj2
    Bootstrap Responsive Web Design Tutorial ➡️ bit.ly/2DFQ2yC ⚫️ bit.ly/2VoJWwH
    MongoDB Tutorial Course ➡️ bit.ly/2LaCJfP ⚫️ bit.ly/2WaI7Ap
    QT C++ GUI Tutorial For Beginners ➡️ bit.ly/2vwqHSZ
    ★★★ Online Courses to learn ★★★
    Get 2 FREE Months of Unlimited Classes from skillshare - skillshare.eqc...
    Data Science - bit.ly/2lD9h5L | bit.ly/2lI8wIl
    Machine Learning - bit.ly/2WGGQpb | bit.ly/2GghLXX
    Artificial Intelligence - bit.ly/2lYqaYx | bit.ly/2NmaPya
    MERN Stack E-Degree Program - bit.ly/2kx2NFe | bit.ly/2lWj4no
    DevOps E-degree - bit.ly/2k1PwUQ | bit.ly/2k8Ypfy
    Data Analytics with R - bit.ly/2lBKqz8 | bit.ly/2lAjos3
    AWS Certification Training - bit.ly/2kmLtTu | bit.ly/2lAkQL1
    Projects in Java - bit.ly/2kzn25d | bit.ly/2lBMffs
    Machine Learning With TensorFlow - bit.ly/2m1z3AF | bit.ly/2lBMhnA
    Angular 8 - Complete Essential Guide - bit.ly/2lYvYRP
    Kotlin Android Development Masterclass - bit.ly/2GcblsI
    Learn iOS Programming Building Advance Projects - bit.ly/2kyX7ue
    ★★★ Follow ★★★
    My Website - www.codebind.com
    DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!

ความคิดเห็น • 116

  • @rickdas354
    @rickdas354 3 ปีที่แล้ว +27

    Genuine guy not boring us by giving lengthy intro. Quality content 😁

  • @carscircle2815
    @carscircle2815 3 ปีที่แล้ว +6

    After watching many video related to this issue , your video helped me and I'm able to run this program successfully,Thank you sir.(Love from Assam,India)

  • @anshumankathait7458
    @anshumankathait7458 3 ปีที่แล้ว +5

    Bro You're a God. All these other videos are full crap. I don't know shit about computers and this vid really helped me. Keep on👍🏼

  • @divyasreebathula3367
    @divyasreebathula3367 3 ปีที่แล้ว +4

    Thank u so much it help me a lot .... I was like watching videos an hour but no video was that clear explained

  • @DrSaav-my5ym
    @DrSaav-my5ym 2 ปีที่แล้ว +2

    Thanks, I was using an IDE but a recent project in my class requires using command line so you just saved my life.

  • @maroofsiddiqui
    @maroofsiddiqui 4 ปีที่แล้ว +1

    I watched nearly 8-9 videos of people who had good Amount of subscriber but they don't worth it.
    Great work bro you deserve more likes.

    • @dimuthusudesh850
      @dimuthusudesh850 3 ปีที่แล้ว

      th-cam.com/video/UcMbREn1RRA/w-d-xo.html

  • @mrtom-a-hawk6732
    @mrtom-a-hawk6732 3 ปีที่แล้ว +3

    Great video that doesn't assume you already some things about this process; clear and concise!

  • @MitchelCosta
    @MitchelCosta 3 ปีที่แล้ว +5

    Thank you much for all your Java videos. Helped me figure a lot of setup questions for my Java class. Appreciate you!

  • @naturesboy7482
    @naturesboy7482 3 ปีที่แล้ว

    Bhai sabke videos try kiye tere video se run hua program 🙏🙏🙏

  •  ปีที่แล้ว

    Thank you man! Your video helped me a lot! :) It was so easy. I was trying to execute a homebrew program that doesn't recognize java but this was THE solution... add the JAVA_HOME system variable.

  • @rohitpatil8132
    @rohitpatil8132 3 ปีที่แล้ว +1

    Simple Short and Perfect Solution
    Thanx Sir

  • @tim_p0
    @tim_p0 3 ปีที่แล้ว +3

    Excellent video, worked perfectly for me. Thank you for taking the time to share your knowledge.

  • @hafsaotaku2818
    @hafsaotaku2818 2 ปีที่แล้ว

    the only usefull and amazing video on youtube concerning this problem was yours,may god bless u

  • @shradhashinde9716
    @shradhashinde9716 3 ปีที่แล้ว

    My First java program Run Successfully .Thank you

  • @dagipaul94
    @dagipaul94 2 ปีที่แล้ว +2

    i install it step by step as shown above it shows me the javac version but when i create a file and run it on cmd it says like this "'D:\New' is not recognized as an internal or external command,
    operable program or batch file. " what is my mistake ??? please someone help me

  • @VII_07
    @VII_07 3 ปีที่แล้ว +2

    Thanks buddy you helped me alot.
    Thanks ❤️❤️

  • @vvvSha
    @vvvSha 3 ปีที่แล้ว +6

    Sir I'm getting system can't find the path specified..what to do sirr

  • @vishnu.s_
    @vishnu.s_ 3 ปีที่แล้ว +1

    thank you.my first successful java program

  • @adesh_k
    @adesh_k 3 ปีที่แล้ว

    sooo legit trick i am succesfully done my first java program!
    thanks a lot

  • @carlossolrac84
    @carlossolrac84 ปีที่แล้ว +1

    If you still cant make it work: 1) Save your file inside a file named "test" on Windows 2) Click the windows button in your keyboard and type cmd 3) Copy the file path of your test file 4) Write: cd 5) Create a Main.java file in the test folder 6) Inside the Main.java file, add the "Main" class (the same name of the file) with the main method: public class Main { public static void main(string[] args) { System.out.println("Hi") } } 7) Change the package name to "package test;" in the first line of the Main.java file 8) Write the command "javac Main.java" in the cmd to compile the file to bytecode 9) Go to the parent folder, by writting the command "cd .." 10) Execute the program, by writing "java test.Main". Observations: verify if you have java installed with the command "java --version", dont forget to write the extension ".java" when compiling, dont write the extension ".class" to execute the compiled file, dont execute inside the test folder, always in the parent folder, dont forget to add the main method, dont forget that the name of the file should be the same as the name of the class, dont forget that java is case sensitive, dont forget to write the correct name of the package inside the file, dont forget to write the name of the package with a dot and then with the name of the file without the extension when running the compiled file.

  • @aneeshaks6550
    @aneeshaks6550 3 ปีที่แล้ว

    Thanku so much sir, it was so helpful .Your content were so perfect and not at all lagging.

  • @omshinde6757
    @omshinde6757 2 ปีที่แล้ว +1

    Thank u sir, it litteraly help me

  • @yogeshpabbisetti4477
    @yogeshpabbisetti4477 3 ปีที่แล้ว +1

    really thanku brother i never forgot u love u

    • @dimuthusudesh850
      @dimuthusudesh850 3 ปีที่แล้ว

      th-cam.com/video/UcMbREn1RRA/w-d-xo.html

  • @sumanthmuktam3300
    @sumanthmuktam3300 2 ปีที่แล้ว

    Atlast it worked...Thanks 🔥

  • @CL50135
    @CL50135 2 ปีที่แล้ว +1

    I followed this exactly to the T and still am getting error file not found

  • @sjjayaswal7621
    @sjjayaswal7621 2 ปีที่แล้ว

    Thanks for information , I have downloaded jdk but not know how to execute it .

  • @CraftyDrafty0
    @CraftyDrafty0 2 ปีที่แล้ว

    Thank you so much for this vd...it really helpful...tx a lot

  • @muhammadilyas-sp5gf
    @muhammadilyas-sp5gf 3 หลายเดือนก่อน

    Hi, sir when i complie the file in command prompt it will makes errors , i write the javac sample.java after pressing the enter it shows the errors, file not found sample.java , my file in notepad is java file not a text. but consistently the prompt shows errors.

  • @sarthakpanda7838
    @sarthakpanda7838 3 ปีที่แล้ว +2

    sir i have done all the steps.
    java -version is working but cd desktop is saying that "The system cannot find the path specified." plz help

    • @kairiannah
      @kairiannah 3 ปีที่แล้ว

      try: java --version (two hyphens)

  • @SS-ur7xb
    @SS-ur7xb 2 ปีที่แล้ว

    Hi I want to see how you compile in NetBeans. Do you have any video about it?

  • @theekshani1237
    @theekshani1237 2 ปีที่แล้ว

    Thank you thank you soooo much sir. It was so helpful

  • @annwiser6957
    @annwiser6957 2 ปีที่แล้ว

    THANK YOU! Quality post.

  • @jananiv7105
    @jananiv7105 2 ปีที่แล้ว

    Sir creating note pad in desktop instead can we create it in local disk E or D is that possible please help me out of this

  • @pritilove7
    @pritilove7 3 ปีที่แล้ว

    Excellent teaching very very great

  • @akhilkumarpatnaikvandrangi9195
    @akhilkumarpatnaikvandrangi9195 2 ปีที่แล้ว

    Thank you... for giving us a good content

  • @Stav2_
    @Stav2_ 3 ปีที่แล้ว +4

    I dont know why but it dont work for me,
    the cmd say "Error: Could not find or load main class aze.java"

    • @Alone_2044
      @Alone_2044 2 ปีที่แล้ว

      Yeah bro how to slove

  • @amaljawahdou2037
    @amaljawahdou2037 10 หลายเดือนก่อน

    Hello Sir , I have a problem the text file is not turning to a java file after renaming it >< what to do !?

  • @alpanapatra7218
    @alpanapatra7218 2 ปีที่แล้ว

    This will work for notepad++ also ?

  • @lockwoowanimations4765
    @lockwoowanimations4765 3 ปีที่แล้ว +1

    in the end when he tells you to do cd desktop it doesnt work what do i do plz help

  • @dinalshah6306
    @dinalshah6306 2 ปีที่แล้ว

    Thanku from my side also

  • @nazarreadymade3669
    @nazarreadymade3669 3 ปีที่แล้ว +1

    ive done all you given but in my cmd is coming "c:User/User>"java-version but the output is not coming in your java program it is coming like" c:User/cb>"

  • @justinedumapi9381
    @justinedumapi9381 3 ปีที่แล้ว +1

    Thank you🥰🥰🥰

  • @rohitshinde2416
    @rohitshinde2416 3 ปีที่แล้ว

    Helpful...! Thanks😊

  • @yogeshwaran3250
    @yogeshwaran3250 ปีที่แล้ว +1

    How to compile i am saving in D: but jdk in c:

  • @HoloGrainYT
    @HoloGrainYT 2 ปีที่แล้ว

    Thank You,
    O great PragrammingKnowledge2

  • @katsukiiiiiiiiiiiiiiiiiiiiiiii
    @katsukiiiiiiiiiiiiiiiiiiiiiiii 4 หลายเดือนก่อน

    im at the 8:00 mark and my pc gives me this when i attemt to use cd "The system cannot find the path specified."

  • @virajkadam5661
    @virajkadam5661 2 ปีที่แล้ว

    thank you so much for your help

  • @wearefamilyrr3491
    @wearefamilyrr3491 ปีที่แล้ว

    GOD BLESS YOU

  • @MRYT-lc2jk
    @MRYT-lc2jk 2 ปีที่แล้ว

    Great sir

  • @gopalghule2741
    @gopalghule2741 3 ปีที่แล้ว

    Thank you so much 🙏🙏

  • @longodough785
    @longodough785 2 ปีที่แล้ว

    Thank you so much!

  • @manoj_marndi
    @manoj_marndi 2 ปีที่แล้ว

    Edit option is not showing for PATH in SYSTEM VARIABLES

  • @rubensilvals5554
    @rubensilvals5554 3 ปีที่แล้ว

    how do u write java -jar name of program.jar? When i do it it gives me this "Error: Unable to access jarfile name of program"

  • @hariniharini1226
    @hariniharini1226 2 ปีที่แล้ว

    Thanks a lot sir

  • @ashaydeokate5673
    @ashaydeokate5673 3 ปีที่แล้ว +1

    Sir it showing error
    error: file not found

  • @aristidebossou
    @aristidebossou 2 ปีที่แล้ว

    excellent. Thanks a lot

  • @perfectboy
    @perfectboy 3 ปีที่แล้ว

    Thank you so much

  • @joshna_jyo9217
    @joshna_jyo9217 3 ปีที่แล้ว +1

    Y am I getting could not find or load main class
    Can somebody PLZZ help🙏

    • @Alone_2044
      @Alone_2044 2 ปีที่แล้ว

      Yeah Me to pls help me

  • @fugeratube1334
    @fugeratube1334 2 ปีที่แล้ว

    thanks sir indeed...

  • @dhushyanth8023
    @dhushyanth8023 2 ปีที่แล้ว

    Bro in my system for me edit option is not showing bro
    in edit enviro....in

  • @nivyaignatious8779
    @nivyaignatious8779 3 ปีที่แล้ว +1

    It didn't work for me😭

  • @SatyamPandeyx2
    @SatyamPandeyx2 3 ปีที่แล้ว

    Thankyou So Much

  • @balajimodalavalasa7657
    @balajimodalavalasa7657 3 ปีที่แล้ว

    Error: could not open `C:\Program Files\Internet Explorer\java\lib\amd64\jvm.cfg'
    i am getting this

  • @cylixinc
    @cylixinc 3 ปีที่แล้ว

    Thanks you

  • @HarshSorate
    @HarshSorate 2 ปีที่แล้ว

    Thanks sir.

  • @gandepranaya8618
    @gandepranaya8618 3 ปีที่แล้ว +1

    I am unable to compile the content promp
    The process as u as done
    But y I am unable to

  • @christopherroshan1699
    @christopherroshan1699 3 ปีที่แล้ว

    Thanks ma brother 😘

  • @aristidebossou
    @aristidebossou 2 ปีที่แล้ว

    very helpful

  • @bharathkumar.k4131
    @bharathkumar.k4131 2 ปีที่แล้ว

    Sir cd Desktop cannot find path specified
    Wt to do sir

  • @sidghadge_4588
    @sidghadge_4588 หลายเดือนก่อน

    thanks

  • @prashiknagrale6613
    @prashiknagrale6613 2 ปีที่แล้ว

    website is asking for creating oracle account

  • @ChampsWorld937
    @ChampsWorld937 9 หลายเดือนก่อน

    Thankyouuu!!!!

  • @rohininarsingraoambegave2022
    @rohininarsingraoambegave2022 3 ปีที่แล้ว

    thank you so muchsir

    • @dimuthusudesh850
      @dimuthusudesh850 3 ปีที่แล้ว

      th-cam.com/video/UcMbREn1RRA/w-d-xo.html

  • @callmeyeongju3317
    @callmeyeongju3317 2 ปีที่แล้ว

    Thanks a loT!!!

  • @umeshmokashe1459
    @umeshmokashe1459 2 ปีที่แล้ว

    Thanks sir

  • @afasanashaikh1774
    @afasanashaikh1774 2 ปีที่แล้ว

    Sir Java is not run in command prompt why can I do

  • @muskanmall4401
    @muskanmall4401 3 ปีที่แล้ว

    thank you

  • @rohitnepal7674
    @rohitnepal7674 2 ปีที่แล้ว

    It says file not found. Help!

  • @BTBprincejasoria
    @BTBprincejasoria 3 ปีที่แล้ว

    Sir path pr click krke new ki option hi nhi aati

  • @TechSandy7263
    @TechSandy7263 3 ปีที่แล้ว

    thanks sir

  • @chihironagataa
    @chihironagataa 2 ปีที่แล้ว

    thank u so muchh 😭

  • @aitislol2215
    @aitislol2215 3 ปีที่แล้ว

    javac command not work can you help me

  • @CSE_KaaveeyahS
    @CSE_KaaveeyahS 3 ปีที่แล้ว +1

    Bro I apply what you said but its show error

    • @dimuthusudesh850
      @dimuthusudesh850 3 ปีที่แล้ว

      th-cam.com/video/UcMbREn1RRA/w-d-xo.html

    • @dimuthusudesh850
      @dimuthusudesh850 3 ปีที่แล้ว

      th-cam.com/video/UcMbREn1RRA/w-d-xo.html

  • @AneesKhan-zf2si
    @AneesKhan-zf2si 3 ปีที่แล้ว

    My system is not showing the javac version and can't compile also

    • @dimuthusudesh850
      @dimuthusudesh850 3 ปีที่แล้ว

      th-cam.com/video/UcMbREn1RRA/w-d-xo.html

  • @AyushGupta-sn8mj
    @AyushGupta-sn8mj 3 ปีที่แล้ว

    Hello sir class file is not opening

  • @lovivlog45
    @lovivlog45 3 ปีที่แล้ว

    Sir plz Java ka program rin nahi ho pa raha h

  • @niranjane5906
    @niranjane5906 4 ปีที่แล้ว

    will this work for windows 7????

    • @boredlang5953
      @boredlang5953 3 ปีที่แล้ว +1

      You should update your pc bro

  • @chenchen4360
    @chenchen4360 2 ปีที่แล้ว

    lifesaver

  • @parrurox01
    @parrurox01 2 ปีที่แล้ว

    danke

  • @PickleRickSanchez
    @PickleRickSanchez 3 ปีที่แล้ว +1

    I don’t get how to run Java once installed

    • @dimuthusudesh850
      @dimuthusudesh850 3 ปีที่แล้ว

      Java programming language❤️😎👍th-cam.com/video/UcMbREn1RRA/w-d-xo.html

  • @cushplayz2974
    @cushplayz2974 4 ปีที่แล้ว

    FIRST!!!!!!!!

    • @dimuthusudesh850
      @dimuthusudesh850 3 ปีที่แล้ว

      th-cam.com/video/UcMbREn1RRA/w-d-xo.html

  • @idspvaranasi9912
    @idspvaranasi9912 3 ปีที่แล้ว

    Copied video hai

  • @dinushiariyasena653
    @dinushiariyasena653 3 ปีที่แล้ว

    Thank you so much!

  • @5h8_b.keerthireddy68
    @5h8_b.keerthireddy68 3 ปีที่แล้ว

    Thank you so much

  • @gianni5423
    @gianni5423 3 ปีที่แล้ว

    Thanks you

  • @shivamtomershiv
    @shivamtomershiv 3 ปีที่แล้ว

    thanks