JAR and Packages - PowerPoint PPT Presentation

1 / 5
About This Presentation
Title:

JAR and Packages

Description:

Course organization, PowerPoint lectures, (team work) project, deadline ... place all files that your application needs into a JAR file ... – PowerPoint PPT presentation

Number of Views:59
Avg rating:3.0/5.0
Slides: 6
Provided by: usersC1
Category:
Tags: jar | ajar | packages

less

Transcript and Presenter's Notes

Title: JAR and Packages


1
JAR and Packages
  • Section 4.5 (JIAs)
  • Section 3.3 (ALBINGs)
  • Section 5.11 (ALBINGs)

2
Announcements
  • Evaluations (6) Satisfied with course and me
  • Course organization, PowerPoint lectures, (team
    work) project, deadline flexibility, in-class
    exercises, and posting assignments/projects
    online ahead of time
  • Some requests
  • More info on expectations for assignments and
    quizzes (will do)
  • Project description not clear (intended)
  • More time for reports (spread out evenly through
    the term) --- better time management
  • Eliminated Back-office
  • Divided revisiting design into two (4 5)
  • 17 days for phase 3 Prototype
  • 27 days for phase 6 Revisit Prototype (add
    Contracts, Invariants, Test Classes, Packages
    JAR)
  • 15 days for phase 7 Complete System (with UI,
    refactoring, JDBC and Maintenance)
  • All samples on N\CS230
  • Talks reminder (MON WED)
  • Appointments (tomorrow) to demo Projects

3
Self-Running JAR files
  • To package an application
  • place all files that your application needs into
    a JAR file
  • add manifest entry that specifies the main class
    of your program
  • A file containing the line Main-Class
    edu/csbsju/cs/Employee
  • CAVEAT
  • dont add .class to the main class name
  • last line in manifest must end with a newline
    character
  • jar cvfm Employee.jar mainclass.mf edu
  • edu directory processed recursively
  • jar cvfm JARTest.jar ManInf PackageTest. edu
  • Users can now run the program as
  • java jar Emloyee.jar
  • Use jar xvf to show Manifest file

4
JARTest.jar
  • jar cmfv ManInf JARTest.jar
  • ManInf
  • Main-Class PackageTest
  • java -jar JARTest.jar

5
Exercise
  • Go to N\CS230\Packages_JARs\PackageTest
  • Create a package structure to match the package
    definition in Employee class (use your username
    instead of the string USERNAME) and update the
    package definition accordingly
  • E.g. package edu.csbsju.cs.irahal
  • Update class PackageTest to access the Employee
    class properly (dont use an import statement)
  • Update class PackageTest to access the Employee
    class properly using an import statement
  • Create a Self-Running JAR file that contains
    class PackageTest and the package
  • When run, the JAR files should run class
    PackageTest
  • Use command jar xvf JAR-FILE-NAME to extract the
    contents of the JAR file
  • check the content of the file in the META-INF
    directory
Write a Comment
User Comments (0)
About PowerShow.com