Comp 110 Recitation 1 Java Installation - PowerPoint PPT Presentation

1 / 44
About This Presentation
Title:

Comp 110 Recitation 1 Java Installation

Description:

Use basic text editor such as Notepad. In Java, this requires running 'javac' ... You can use Windows Explorer to see if it exists ... – PowerPoint PPT presentation

Number of Views:20
Avg rating:3.0/5.0
Slides: 45
Provided by: sasA5
Category:

less

Transcript and Presenter's Notes

Title: Comp 110 Recitation 1 Java Installation


1
Comp 110Recitation 1Java Installation
  • Instructor Sasa Junuzovic

2
Agenda
  • Questions
  • Announcements
  • Software Installation
  • Bare-bone environment
  • Running the First Java Program

3
Announcements
  • Honor Code Pledge
  • Check Assignments on Blackboard to sign the
    Pledge
  • Office Hours
  • M 430-530, Th 200-300
  • Or by appointment
  • Class Notes
  • Now available for Theater Model of a Computer
  • LiveMeeting
  • Access to Live Meeting and the recordings will be
    available to you
  • Assignment 1 handed out today

4
Software Installation What do we Need?
Use basic text editor such as Notepad
Source Code
In Java, this requires running javac
Compiler
We will use two other tools for now
Console Window Command Prompt
Platform Independent Intermediate Code
ObjectEditor Driver
Interpreter
In Java, this requires running java
Platform Specific Machine Code
Processor
5
Software Installation
  • For those of you who were in class on Friday Aug
    24, 2007
  • If you were able to bring successfully load the
    ObjectEditorComp110 program (shown below) then
    your installation is complete. You do not have to
    go through the rest of the slides in this
    presentation.

6
Software Installation
  • Assumption You have Windows XP and are using
    Mozilla Firefox to browse the Web
  • There are separate instructions for Mozilla
    Firefox users and/or Mac users

7
Java Installation
  • Open the Following Website in Firefox
  • http//java.sun.com/javase/downloads/
  • Click the Download Button for JDK 6 Update 2

8
Java Installation
  • Select the Accept option to continue

9
Java Installation
  • Click on the Windows Offline Installation link

10
Java Installation
  • Click on Save File

11
Java Installation
  • File should have been downloaded to the location
    stated here
  • In this case, it was downloaded to the desktop
  • We assume that it was downloaded to your desktop
    from now on

12
Java Installation
  • When download completes, run the
    jdk-6u2-windows-i586-p.exe file
  • On the first screen, press Accept

13
Java Installation
  • Press Next on the following screen

14
Java Installation
  • Press Next on the following screen

15
Java Installation
  • Uncheck the Show the readme file
  • Click the Finish button

16
Setting Up The Environment
  • Click Start
  • Right-click on My Computer
  • Click on Properties

17
Setting Up The Environment
  • Select the Advanced tab

18
Setting Up The Environment
  • Click on Environment Variables

19
Setting Up The Environment
  • Find the Path variable in the list on the
    bottom of the screen
  • Click the Edit button

20
Setting Up The Environment
  • At the end of the Variable value field, enter
    the following (including the quotes)
  • C\Program Files\java\jdk1.6.0_02\bin
  • Do not forget the at the start
  • Do not forget the double quotes
  • Click OK three times to get out of the windows
    you have opened

21
ObjectEditor Installation
  • Open up a command prompt window
  • Click on Start, then Run
  • Type cmd (excluding the quotes) and press Enter

22
ObjectEditor Installation
  • In the command prompt window, you will do three
    operations. Please keep in mind these two rules
  • Rule 1 Do not enter any double quote characters
  • Rule 2 Type the exact text shown below. In
    particular, the case must match, and pay
    attention to the / and \ characters as they
    mean different things.

23
ObjectEditor Installation
  • Operation 1
  • In the command prompt
  • Type cd \
  • And press Enter
  • The only text on the bottom most line should be
    C\gt

24
ObjectEditor Installation
  • Operation 2
  • In the command prompt
  • Type mkdir comp110
  • And press Enter
  • You should see C\gt on the bottom line and no
    errors

25
ObjectEditor Installation
  • Operation 3
  • In the command prompt
  • Type cd comp110
  • And press Enter
  • You should see C\comp110gt on the bottom line
    and no errors

26
ObjectEditor Installation
  • Go to the course webpage
  • http//www.cs.unc.edu/sasa/teaching/fall2007/comp
    110
  • Right-click on ObjectEditor
  • Select Save Link As
  • Save it to c\comp110
  • To do so, follow the next four slides

27
ObjectEditor Installation
  • Click on My Computer

28
ObjectEditor Installation
  • Open up your C drive

29
ObjectEditor Installation
  • Open up comp110

30
ObjectEditor Installation
  • Click Save

31
ObjectEditor Installation
  • Go back to your command window, type dir and
    press Enter
  • You should see oeall3.jar listed in the output
  • If there is no oeall3.jar listed, then carefully
    re-download oeall3.jar from the course webpage.

32
ObjectEditor Installation
  • Go to the course webpage
  • http//www.cs.unc.edu/sasa/teaching/fall2007/comp
    110
  • Right-click on ObjectEditorComp110
  • Select Save Link As
  • Save it to c\comp110, just like you did
    oeall3.jar

33
ObjectEditor Installation
  • Go back to your command window, type dir and
    press Enter
  • You should see oeall3.jar and ObjectEditorComp110.
    java listed in the output
  • If either is missing, then carefully re-download
    the missing one from the course webpage.

34
Compiling Your First Java Program
  • Go to your command prompt window
  • NOTE Make sure you are in the comp110
    directory
  • You are if the text on the bottom line of the
    command prompt window contains exactly
    c\comp110gt
  • If you are not in the comp110 directory, do the
    following
  • Type cd \ in the command prompt window and
    press Enter
  • Type cd comp100 in the command prompt window
    and press Enter

35
Compiling Your First Java Program
  • Compiling
  • In the command prompt window, enter the following
    (excluding the quotes)
  • javac -classpath oeall3.jar .java
  • Press Enter
  • There should be no errors reported. If there are
    check the slides at the end of the presentation
    which provide solutions to possible compile errors

36
Running Your First Java Program
  • Running
  • In the command prompt window, type the following
  • java classpath .oeall3.jar
    ObjectEditorComp110
  • Do not forget the . just before oeall3.jar
  • Press Enter and the following window should
    appear
  • If there are errors in the command prompt window,
    see the slides at the end of the presentation for
    solutions

37
Running Your First Java Program
  • Finished
  • Congratulations, you have successfully installed
    Java and ObjectEditor
  • The remaining slides are only for handling errors
    encountered during the installation

38
(No Transcript)
39
Problems and Solutions
40
Possible Compile Errors
  • If you get the following error message
  • javac is not recognized
  • Verify that the following folder exists
  • C\Program Files\java\jdk1.6.0_02\bin
  • You can use Windows Explorer to see if it exists
  • If it does not exist, you must follow the steps
    for installing Java
  • If it exists, then you must follow the steps for
    setting up the environment

41
Possible Starting Errors
  • If you get the following error message
  • You must repeat the steps for Compiling Your
    First Java Program

42
Possible Starting Errors
  • If you get something similar to the following
  • You need to re-download the ObjectEditor from the
    course webpage
  • Make sure you download it to the c\comp110
    directory
  • You can overwrite the one already in the directory

43
Possible Starting Errors
  • If you get the following
  • Check the spelling of the command
  • Make sure you have the correct case. Here,
    Objecteditorcomp110 should be ObjectEditorComp110

44
Possible Starting Errors
  • If you an error stating something about not being
    able to open a zip file, then please download
    oeall3.jar again
  • You can overwrite the one you already have
Write a Comment
User Comments (0)
About PowerShow.com