1 / 17

Comp 110/401 Appendix: Installing and Using Bare Bones Development Environment on Windows

Comp 110/401 Appendix: Installing and Using Bare Bones Development Environment on Windows. Instructor: Prasun Dewan (FB 150, dewan@unc.edu). Install Latest JDK and JRE. Look at Install JDK Documentation. Create Folder for All Java Projects You Create.

kolya
Download Presentation

Comp 110/401 Appendix: Installing and Using Bare Bones Development Environment on Windows

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. Comp 110/401 Appendix: Installing and Using Bare Bones Development Environment on Windows Instructor: PrasunDewan (FB 150, dewan@unc.edu)

  2. Install Latest JDK and JRE Look at Install JDK Documentation

  3. Create Folder for All Java Projects You Create

  4. In Java Folder Create Project Folder for This Warmup Exercise

  5. In Project Folder Create Project-Source (src) and Project-Binary (bin) Folders

  6. In Source Folder Create Source-Package Folder

  7. Use Command Interpreter to CD to Source Package FOLDER See command Interpreter documentation on CD and Pasting Text such as Folder Names in Command Interpreter

  8. Use a Text Editor to Create New Source Java File

  9. Copy and Paste Code in Text Editor and Save File Package folder name Source file without .java package warmup; import java.io.BufferedReader; import java.io.InputStreamReader; public class AGreeter { static BufferedReaderinputStream = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) { System.out.println("Hello World"); if (args.length > 0) { System.out.println(args[0]); } try { System.out.println (inputStream.readLine()); } catch (Exception e) { System.out.println("Could not read line"); e.printStackTrace(); } } }

  10. Compile Source File See Command Interpreter documentation on how to set PATH if you will use the barebones environment again JDK Binary Folder followed by \javac, in quotes Source file name Project-binary folder Directory (folder) option

  11. Explore Package Binary Folder Automatically created binary package folder Automatically crated Binary-file If you do not see the binary package folder or the binary file, and no errors were reported, check that you saved the source file (by say reopening it)

  12. Cd to Project Binary Folder and Run Java Interpreter with Full Class Name Output Full class name

  13. Input a Line Input

  14. Hit Enter and See Output Echoed Input

  15. Providing User Argument User argument in quotes

  16. Seeing Echoed Argument Echoed Argument

  17. HIT CTRL-C to Terminate Program Waiting for User Input Forcibly Terminated program

More Related