1 / 18

How to Run Java Applications using the Windows Command Prompt.

How to Run Java Applications using the Windows Command Prompt. Julian Falasca May 11 th , 2010 ENGL 393. Introduction. Purpose: Most IS courses don’t touch this topic. Target Audience: Students already familiar with Java programming. (CMSC and IS majors) When to Use: On the job.

Download Presentation

How to Run Java Applications using the Windows Command Prompt.

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. How to Run Java Applications using the Windows Command Prompt. Julian Falasca May 11th, 2010 ENGL 393

  2. Introduction • Purpose: Most IS courses don’t touch this topic. • Target Audience: Students already familiar with Java programming. (CMSC and IS majors) • When to Use: On the job. • Safety Information: Don’t get too excited.

  3. Materials Needed • At least 1 valid java source file. (HelloWorld.java) • Must know where this file is located. • Java Development Kit (JDK) already installed. • http://java.sun.com/javase/downloads/index.jsp

  4. Step 1 • Click on Start, Programs, Accessories, and select Command Prompt.

  5. Example Command Prompt

  6. Step 2 • This example uses a java file which is located:D:\Workspace\HelloWorld.java • Type d: and press enter. • This command changes directories to the D drive.

  7. Example Command Prompt

  8. Step 3 • Type cd Workspace and press enter. • This takes you into the Workspace directory.

  9. Example Command Prompt

  10. Step 4 • Type dir and press enter. • This displays a list of files in the current directory. • Confirm that HelloWorld.java is in the list.

  11. Example Command Prompt

  12. Step 5 • Type javac HelloWorld.java and press enter. • This compiles the file, allowing you to run it. • A new file has been created named HelloWorld.class.

  13. Example Command Prompt

  14. Step 6 • Type java HelloWorld and press enter. • The Java application will run.

  15. Example Command Prompt

  16. Conclusion • Warranty Information: N/A • Technical Support: Lookup commands on google. • FAQs: • Why do I get the error “javac command not recognized”? • Most likely you have not installed the JDK correctly. • How do I go to the previous directory? • Type cd .. and press enter.

  17. Conclusion Continued

  18. Questions?

More Related