Here “cd” is to set the path and then you set the whole path to the file inside “”, so that if there is any space in any folder name, it doesn’t cause any problem. To change your path or cmd or terminal directory follow the image below So that you can easily compile and run it. You have to change the path to your desired java program location. In your cmd there will be a path to your C: drive. But don’t worry, I am using a terminal from microsoft that I downloaded from the microsoft store and then I also added some styling to my terminal. Your cmd and my terminal may not look the same. To do that, write in your search bar of your windows, cmd and then click enter. Open your command prompt, that is, “cmd”. And then you have to run the class that contains the main method. In java if you want to compile and run the java program, this is how you do it:Īt first you have to compile the java program. As a programmer you need to learn to use the terminal.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |