0% found this document useful (0 votes)
7 views1 page

Compiling and Running Java Programs

This document provides step-by-step instructions for compiling and running Java code. It includes creating a folder on the desktop, writing Java code in Notepad, saving it with a specific naming convention, and using the command prompt to compile and run the program. The instructions emphasize checking for errors during compilation and execution.

Uploaded by

jarredjoven72
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Compiling and Running Java Programs

This document provides step-by-step instructions for compiling and running Java code. It includes creating a folder on the desktop, writing Java code in Notepad, saving it with a specific naming convention, and using the command prompt to compile and run the program. The instructions emphasize checking for errors during compilation and execution.

Uploaded by

jarredjoven72
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Compiling and running your Java codes.

1. Create a folder in the desktop.


a. On desktop, right-click the mouse and select new then folder.
b. Name your folder “10 - Section". Ex. 10-Pascal
2. Open the notepad app.
3. Write your Java code and save it to your created folder.
a. Your classname must be your first name followed by the program you are
writing. Ex. “Arvin3x” for multiplication x3 program.
b. Save the program with the file name exactly like your classname. Ex.
“[Link]”
4. Open command prompt app.
5. Locate the folder you have created.
a. Enter the code “cd C:\users\admin\desktop\10-section” Ex. 10-algorithm
b. Verify that you have opened the folder by checking the location at the left part
of the command prompt, the folder name must be displayed before the
blinking cursor.
6. Compile your Java program.
a. Enter the code “javac [Link]” Ex. javac [Link] and press Enter.
b. If there are code errors, it will be displayed. If there are no errors, you should
be able to view the location of the folder and the cursor.
7. Run your Java program.
a. If there are no errors, run your program by entering this code: “java Filename”
Ex. java Arvin3x and press Enter.
b. Your program must run.

You might also like