How to Compile and Run Java Program in Command Prompt ( With Packages ) on Windows 10

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ต.ค. 2024

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

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

    DUDE!! You just saved my day! I just started doing java and never used the cmd. This class I'm in doesn't even show you how to use command prompt to find or access files. It just assumes that you know how to do it. I been searching youtube this whole time and you give the BEST and SIMPLEST way to do it. NICE JOB MAN!

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

    Thank you very much. I am only 14 years old and is studying java for beginners but I was stuck with compiling since I only hava a book as a guide. This was very Helpful.

  • @Hema_Harshini
    @Hema_Harshini 11 หลายเดือนก่อน +1

    Thank you...I have searched for this content a lot..but found the correct one now..Thank you

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

      You're welcome!

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

    This is very helpful, and hard to find. Thank you!

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

    using cmd in the address bar is a really neat trick! thanks

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

    very much Helped try to execute several times couldn't get output,after this i got how to run it,Thank you so much

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

    Thanks dude. I watched all your java videos. I need to master both java and C++. thanks dude.

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

    Very helpful...
    Thankyou...it keeps me motivated to continue further!!!😍

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

    EXCELLENT! Clear explanation and demonstration. Very helpful!

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

    Thank you for such a clear and easy to follow tutorial!!!

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

    This tutorial is very simple and unique, thanks alot

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

    7:00 For source files containing packages
    8:00 -d flag for package folders
    8:20 dot flag - represents folder then give the name of the source file
    8:30 example of the above
    8:48 Overview of what needs to be called
    9:30 Running the program in the terminal
    9:55 For programs containing sub-packages - use full stop to denote a sub-folder followed by its name e.g. one.two = top-level folder called 'one', sub-folder called 'two'.

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

      Thank you for posting

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

    Very helpful and explained thoroughly. Thanks for explaining what -d does. Thank you!

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

    Just like popsmartinez below, I have been struggling with executing from the cmd line all of today, because of this package issue. You were Godsend, my man, Thank you so much. You are the best.

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

    Very informative. Thank you for the wonderful lesson.

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

    Hi, my java program has those import packages such as "import java.io.FileInputStream;
    import java.io.FileNotFoundException;" and some custom SAP frameworks designed by DEVs to perform certain tasks.
    what could be done in this case, if we need to compile java program with this packages.

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

    Thanks for sharing this. It really helped me a lot.

  • @thv2961
    @thv2961 2 หลายเดือนก่อน +1

    Helped me alot thanksss 🤧❤️

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

      Most welcome :)

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

    Very clear. Thank you.

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

    good clear explaination

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

    BRO EXACTLY THIS WAS THE VIDEO THAT I NEED THANK YOU SO MUCH :D

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

    Hey the video is awesome :) and also i have an doubt that why we r putting -d ??

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

      thanks
      By default, javac will output the class file in the same directory as the source file. we can change this behavior by using the "-d" option. It will make javac to output the class file into the specified directory

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

      @@LearningLad thanks for clearing this doubt :D

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

    Thank you so much for this helpful video!

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

    Helpful. wroks perfectly.

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

    Very useful boss thanks

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

    Thank you, This was very helpful

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

    superb explanation broooooo

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

      Thank you so much 🙂

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

    Thanks really helpful I was stuck here now I'm unstuck time to move on ..

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

    So i have a executable file on a flash drive that needs a password to open. Once open it has a java program file (.java), is there a way to run that file through cmd? Have been looking around and haven’t found much. Thanks

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

    thank you for your help. really you helped me a lot.

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

    I got an error message that says "'javac' is not recognized as an internal or external command,
    operable program or batch file." Does that mean I don't have javac installed? I am able to run programs just fine on my IDE, so I'm reluctant to think that's what it is. I would appreciate your help!

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

      If Java is installed then you need to set the path environment variable

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

    Nice video! But everything worked up until I got a class not found error message?

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

    If I want to that one package creates another folder how can I do? I don't want to create inside the example folder

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

    Very helpful ,Thanks

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

    This has been really helpfull!

  • @mr.RAND5584
    @mr.RAND5584 4 ปีที่แล้ว +1

    For windows if main class not found
    c:\folder>java -cp ./classes;. one.two.Hello

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

    thank you bro

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

    good job bro

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

    Thank you soooooo much.

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

    Great ! Explanation

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

    It says javac isn't recognized as an internal or external command when I try to use it

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

      after installing java make sure that you have set the path environment variable

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

    Thank you so much ✨✨✨✨

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

    Thank you sir🙏

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

    really helpful

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

    helpfull,thank you

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

    Awesome

  • @jeddf.torrecampo5851
    @jeddf.torrecampo5851 3 ปีที่แล้ว +1

    Why i am getting 'javac' is not recognize? Pls help

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

      If Java is installed properly then check the path environment variable

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

    Thankyou sir

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

    Nice video

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

    Thank you

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

    Helpful

  • @SHIVAM-1994
    @SHIVAM-1994 ปีที่แล้ว +1

    Thanks !!!!!!!!

  • @VenkatReddy-il7ee
    @VenkatReddy-il7ee 4 ปีที่แล้ว +1

    It is showing that could not find main class the hello

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

      check for spelling, uppercase lowercase in the file containing the code.

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

    Thanks

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

    DISLIKE

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

    Very helpful and explained thoroughly. Thanks for explaining what -d does. Thank you!

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

    Very clear. Thank you.

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

    Thank you very much.