CIS110203 Intro to Computer Science Graphics Project - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

CIS110203 Intro to Computer Science Graphics Project

Description:

Like a zip file keeps all these files together and compresses them too! ... If you're getting an error about a jar command not being found, you must find ... – PowerPoint PPT presentation

Number of Views:41
Avg rating:3.0/5.0
Slides: 10
Provided by: cat
Category:

less

Transcript and Presenter's Notes

Title: CIS110203 Intro to Computer Science Graphics Project


1
CIS110-203Intro to Computer Science Graphics
Project
  • TA Catherine Stocker
  • University of Pennsylvania
  • 5 December 2007

2
Todays Agenda
  • Jar Files
  • Questions

3
JAR Files
  • Why JAR files?
  • Like a zip file keeps all these files together
    and compresses them too!
  • So mom and dad can run it
  • They just have to install the jdk (like you did
    at the beginning of the semester).
  • You send it. They download, double click and
    play Pong!

4
JAR Files
  • Put all .java and .class files into one directory
    (folder). Make sure everything is saved and
    compiled.
  • Create a file manifest.txt in a text editor
  • Windows notepad
  • Mac terminal?vim or emacs or download
    Smultron
  • Linux KWrite

5
JAR Files
  • Copy (change mainClassName to the name of
    whatever class has your main method)
  • Manifest-Version 1.0
  • Main-Class mainClassName
  • dont forget to put a colon between
    Manifest-Version and 1.0 its missing in the
    write-up

6
JAR Files
  • Open a terminal/command prompt window and find
    the directory you have all the files in. Use two
    commands to get there
  • To change to a new directory cd directoryName
  • --gets you to directoryName if thats within
    your current directory.
  • To see the contents of the directory youre
    currently in
  • Windows dir
  • Mac Linux ls lists whats in the
    directory youre in --Helpful for navigating
  • SUGGESTION Move the folder to the Desktop for
    now, its easy to find there.

7
JAR Files
  • Execute the following command
  • jar cvfm gameName.jar manifest.txt .java
    .class
  • --gameName.jar is the jar file youre creating
  • --manifest is the file that you just created,
    tells it where the main method is (if your
    manifest file has no extension then just type
    manifest (no .txt), if it has a txt extension use
    manifest.txt)
  • --.java .class means you want to include all
    .java and .class files in the current directory
  • Beware Where does your jar.exe file live? It
    was part of the jdk you downloaded at the
    beginning of the semester. If youre getting an
    error about a jar command not being found, you
    must find jar.exe and add it to your path or type
    its full pathname

8
JAR Files
  • Run your code java -jar gameName.jar
  • Do this today in lab! Make sure you know how to
    do it. Its not worth turning your homework in
    late over.
  • If youre going to turn in your work from a
    non-lab computer, do it tonight on that
    computer!!!

9
To Do
  • Window, draw circle, get mouse input
  • All of this requires 4 extra lines added to
    code supplied in the first graphics lecture
  • Timer
  • From the last lecture
  • JAR File
  • Try today!
  • Collision Detection and Response
  • This is the tricky part, start now!!
  • Game
  • The fun part
Write a Comment
User Comments (0)
About PowerShow.com