עיצוב תוכנה מונחה עצמים תירגול 1. 1.Packages and Paths 2.Jar Files Outline.

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming Lecture 4 Writing Java Applications, Java Development Tools.
Advertisements

Introduction to Java 2 Programming Lecture 3 Writing Java Applications, Java Development Tools.
Extending Eclipse Kai-Uwe Mätzel IBM OTI Labs Zurich
Cognos Web Services Business Intelligence. SOA SOA (Service Oriented Architecture) The SOA approach involves seven key principles: -- Coarse -grained.
Developing an Eclipse Plug-in David Gallardo. Platform Runtime Workspace Help Team Workbench JFace SWT Eclipse Project Java Development Tools (JDT) Their.
Classpaths, packages, jarfiles, and all that gunk. Ch 4, pp es.html.
Goals Give you a feeling of what Eclipse is.
ANT – Another Neat Tool Representation and Management of Data on the Internet.
Creating Jar Files Jin Hung, Gregory Olds, George Blank, Sun Java Web Site.
Objectives:1. Archiving and Packaging Java Code 2. The jar Program 3. Example Applet JAR Files.
Computer Science A 13: 31/3. From.java to.exe - classpath - jar - resources - wrapper/launcher.
JAR and Packages Section 4.5 (JIA’s) Section 3.3 (ALBING’s) Section 5.11 (ALBING’s)
JAVA PROGRAMING LANGUAGE. Content of Java 2 SDK  Development Tools (In the bin subdirectory.) Tools and utilities that will help you develop, execute,
1 Applets. 2 Motivations When browsing the Web, you frequently see the graphical user interface and animation developed using Java. These programs are.
Objectives:1. Archiving and Packaging Java Code 2. The jar Program JAR Files.
Slides prepared by Rose Williams, Binghamton University Chapter 5 Defining Classes II.
Winter 2005Jason Prideaux1 Apache ANT A platform independent build tool for Java programs.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L06 (Chapter 16) Applets.
Installing JDK Vijayan Sugumaran Department of DIS Oakland University.
By Dr. Jiang B. Liu 12. The Java Beans. Java Beans n JavaBeans is a portable, platform-independent software component model written in Java. It enables.
1 Chapter 3 Programs and Packages. 2 Java Virtual Machine (JVM) Java programs execute on the JVM. The JVM is a virtual rather than a physical machine,
Java Jar Files Bar-Ilan University תשס"ה by Moshe Fresko.
Views Dwight Deugo Nesa Matic
Deploying Java applications as JAR files SE-2030 Dr. Mark L. Hornick 1 How to package an application so that you can run it outside of Eclipse.
Chapter 55 How to Construct JAR files for Program Distribution.
Marlene Galea.  The JDK (Java Development Kit)  An IDE (Integrated Development Environment) ◦ Different IDEs include:  JCreator  NetBeans  BlueJ.
Using Ant to build J2EE Applications Kumar
1 CSE 331 Java Packages; JAR Archives slides created by Marty Stepp based on materials by M. Ernst, S. Reges, D. Notkin, R. Mercer, Wikipedia
PACKAGES Mimi OpkinsCECS277. What We’ll Cover  Packages and Import Statements  The Package java.lang  Package Names and Directories  The Default Package.
Using Eclipse. What is Eclipse? The Eclipse Platform is an open source IDE (Integrated Development Environment), created by IBM for developing Java programs.
Deploying Java applications as JAR files SE-2030 Dr. Rob Hasker 1 Based on material by Dr. Mark L. Hornick.
Introduction Use of makefiles to manage the build process Declarative, imperative and relational rules Environment variables, phony targets, automatic.
Deployment via jars and Webstart. How do we distribute our application? Lab says you need to submit CD Lab says you need to submit CD Limitations of CD.
Guide to Linux Installation and Administration1 Chapter 4 Running a Linux System.
EE2E1. JAVA Programming Lecture 3 Java Programs and Packages.
Ant & Jar Ant – Java-based build tool Jar – pkzip archive, that contains metadata (a manifest file) that the JRE understands.
JDBC Tutorial CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
Installing JDK Vijayan Sugumaran Department of DIS Oakland University.
9.1 Java Packages A collection of classes Allows classes to be grouped arbitrarily Hierarchical structure independent of inheritance Classes can.
22-July-2002cse142-13B-Development © 2002 University of Washington1 Development Tools CSE 142, Summer 2002 Computer Programming 1
1 Compiler Construction (CS-636) Muhammad Bilal Bashir UIIT, Rawalpindi.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
Henrik Bærbak Christensen1 Build Management Clean environment that works...
Building Packages BCIS 3680 Enterprise Programming.
introductory lecture on java programming
Jar Files The Basics. 2 Outline Create a Jar Viewing the Contents of a JAR File Extracting the Contents of a JAR File Modifying a Manifest File Running.
Packages. Access Specifications Public Available anywhere (public keyword) Only one public class per file allowed Protected Available in subclasses, and.
Install CB 1.8 on Ubuntu. Steps Followed Install Ubuntu (Ubuntu LTS) on Virtual machine – (VMware Workstation) (
Today Javadoc. Packages and static import. Viewing API source code. Upcoming Topics: –protected access modifier –Using the debugger in Eclipse –JUnit testing.
Installing and Using Evolve Evolve is written in Java and runs on any system with Java 1.6 Download Evolve from Unzip.
Lecture 4 FrameEditorDemo Packages System Object Runtime Object File Systems.
Packages In Java.
CLOUD
Python’s Modules Noah Black.
Goals Give you a feeling of what Eclipse is.
JavaOne BOF: The Legacy Developer’s Guide to Java 9
Download TPL.zip to some directory
Software Development Jar Files for Applications and Libraries
CMPE 152: Compiler Design ANTLR 4 and C++
JAR Files Objectives: 1. Archiving and Packaging Java Code
Java Packages B.Ramamurthy 11/11/2018 B.Ramamurthy.
Java 9 Project Jigsaw / JSR 376: JavaTM Platform Module System.
TOSCA-Metadata (directory )
Understanding and Creating Jar files in Java
TOSCA-Metadata (directory )
JavaTeaching and Importing a github repository
File Organization.
Executable Jars Dan Fleck Fall /27/2018.
Most Common Grading Issues
Classes 5/5 May 14, 2019 ICS102: Classes 5/5.
Presentation transcript:

עיצוב תוכנה מונחה עצמים תירגול 1

1.Packages and Paths 2.Jar Files Outline

Package rules:  Each class belongs to a package  Package may have sub-packages  A package path is dot-separated  foo.goo.Boo Class Boo, sub-package goo, package foo  Sub-packages has no special properties or privileges Packages

Package declaration package foo.goo; class Boo {...} Package (cont'd) Importing classes from other packages import fi.fy.Fum; // Just class Fum import bar.baz.*; // All classes in bar.baz

When looking for a class, the JRE looks for a.class file in directories that match the package path: Sub-package = Sub-directory. The root directory is the classpath. Finding a Class Find the class foo.goo.Boo in the directories tree +-classpath | foo | goo |-X.class |-Y.class |-Boo.class

A classpath can contain several roots Finding a Class (cont'd) Finding foo.goo.Boo in classpath=A:B:C A +-A +-fi +-fy |-Fum.class |-... B +-B | foo | goo |-X.class |-Y.class C +-C | foo | goo |-W.class |-Z.class |-Boo.class

Jar files are the Java equivalent to libraries and executables. A jar file is a zip archive that contains: .class files  Other needed resources (images, config files)  A manifest file (optional)  Source files (optional) Jar Files

The manifest file is a text file with key: value properties. The JRE reads these properties when it loads the.jar file. Important properties in a jar manifest  Manifest-Version: For backward compatibility.  Main-Class: The class containing the main method to run.  Class-Path: Space-separated list of other class paths to use. See for details on jar and manifest specifications. The Manifest File

Manifest.mf Manifest-Version: 1.0 Main-Class: a.b.c.Foo Class-Path: mylib1.jar mylib2.jar Manifest example

Jar files as Java executables You can run a jar file by running: java -jar jar-file (Or double-click on it, in some systems) The Java Runtime will load all the content of the jar, including its classpath, and will run the main class that is written in the manifest. Using Jar files Jar files as Java shared libraries Including a jar file in a classpath will cause the JRE to look in the archive for classes and resources, as if it was another directory.

Creating a jar file using the command-line tool: jar cf files... Creating Jars