Difference between jar file and package?

What is difference between a package and jar?
Is a jar a package? or is package jar?
If I say
package pink;
does it mean pink is folder or jar?
what if I say import pink.rose;
does it import jar file with the rose class inside it?

These two concepts are unrelated. A jar file is nothing more than a zip file of class files and other related resources, which you can use to 'bundle' your application for ease of deployment. Th use of zip files is not mandatory.
Packages on the other hand, are a means of 'packaging' parts of an application or library in their own namespace, generally for reasons program structure, and to avoid naming collisions. A bunch of classes in a package will be compiled into a bunch of class files, on a one-to-onwe basis (one file per class).
You may chose to 'bundle' those and other classes into a jar file.

Similar Messages

  • Difference between .jar, .war and .ear file

    Hi,
    I am pretty new to J2EE technology.
    I would like to know what is the difference between .jar, .war and .ear files and how they are deployed on webserver.
    Thanks,

    Files with a .jar extension or JAR files, are essentially just a collection of files compressed using the ZIP/ZLIB compression format.
    JAR (short for Java Archive) files were introduced in the early days of Java as a means to conveniently package and distribute Java applications and components. Since then, a number of additions to the Java platform have followed suit. The introduction of the EAR file is one such addition.
    An EAR (Enterprise Archive) file is a JAR file that contains a J2EE application.
    A J2EE application is a group of Web modules that collectively perform as a single entity.
    A Web Module is an entity consisting of one or more resources such as HTML files, Java class files, XML files, etc. Web Modules are packaged in Web Archive (WAR) files.
    Looking at it from a top-down view, EAR files contain JAR files and WAR files. Packaging resources in WAR files, JAR files and eventually EAR files, makes it easy to reuse and reassemble components as new J2EE applications and distribute them to new environments.
    For example, Tomcat deals only with WAR files.
    So, in order to auto-deploy a Web application to a Tomcat environment, you must place an application's WAR file in the appropriate directory or use Tomcat's deployment tools to manually deploy the file.
    If you already have an EAR file that contains the WAR file, you can extract the WAR file and use it as is. If you do not have the EAR file or the WAR file, you can use any number of compliant tools to create the WAR file. Tomcat is a servlet/JSP container available from the jakarta.apache.org site.

  • Difference between .war file and .ear file

    Hi,
    what is the difference between .war file and .ear file ?
    Please let me know with appropriate explanation.

    War file means web application archive. It is archived file having a collection of JSP, servlets and static pages that together costitute a web application. It contains one WEB-INF directory which will have a file named web.xml which defines the structure of the web application.
    On the other side EAR file is Enterprise application archive. It is file having packaged content of one or more modules into a single archive so that the deployment of all the modules can be done simultaneously on the application server. It also contains XML files called deployment descriptors which gives the details of the deployment method. This deployment descriptor will be present in the folder META-INF folder.
    So the main difference betwwen the two is that Ear file is having collection of various modules to be deployed on the application server while the WAR file is used to deploy the web applications.

  • Difference between analytic privilege and package privilege

    Hello Team
                       Please suggest me on the difference between Analytic privilege and package privilege . Since both the privileges works on package only . So what is the exact difference between them .
    Regards

    Hi,
    SAP HANA have several categories of privileges such as system privileges, object privileges, analytic privileges, package privileges and application privileges.
    For analytic privileges and package privileges, they are very different.
    When you use analytic privileges, you can grant different users to see different data. For example you have an analytic view including some sales data and there is a column LOCATION. You can use analytic privilege to grant the sales in the east US to only see the sales data where LOCATION = "EAST" and grant the sales in the west US to only see the sales data where LOCATION = "WEST". This is just a simple example. In short, you use analytic privileges to grant different users to see different data.
    Regarding package privilege, when you develop on XS projects, you can grant different package privileges to different users. For example, you have a package named "services" in your XS project. You can use package privilege to grant user A to only read the content under "services" and grant user B to edit/activate or even delete the "services" packages.
    Best regards,
    Wenjun

  • What is the difference between handling unit and packaging material

    hi
    what is the difference between handling unit and packaging material

    Hi,
    A handling unit is a physical unit that consists of the packaging materials (load carrier / packaging material) and the goods contained therein. A handling unit is always a combination of materials and packaging materials. All the information contained in the material items, such as batches and serial numbers, is always available by way of the handling units.
    Packaging materials are intended to enclose or hold together the materials that are to be packed. In other words, the material that is to be packed can be packed into or onto the packaging material. The packaging material can be a load carrier. The most important packaging materials include crates, boxes, containers, wire baskets, and pallets.
    Regards,
    Naveen

  • Difference between database, websheet and packaged applications

    Hi,
    Can any one explain the difference between database, websheet and packaged applications?
    So far i have worked on database application and not aware of the other applications.
    Regards
    Narender B

    Narender wrote:
    Can any one explain the difference between database, websheet and packaged applications?
    So far i have worked on database application and not aware of the other applications.
    This is fully covered in the documentation:
    About Database Applications
    About Websheet Applications
    About Packaged Applications
    There is little difference between packaged applications and database applications, other than that packaged applications are supplied by Oracle and database applications are created by you.

  • Difference between importing files and adding files/folders to liabrary?

    When I want to bring in new music into my liabrary from my my music folder, I don't know the difference between importing them and adding a file. They both seem to bring up the my music folder and seem to give me the same options?

    To quote from the following link:
    "When you add something to the library, essentially you are taking existing audio or movie files and adding an entry for each to your iTunes Library index. iTunes adds entries in your iTunes library for the selected files, and copies the files to your iTunes Music folder (if you have that option selected in the Advanced pane of iTunes preferences)."
    "The Import menu item allows you to import playlists and other data files into iTunes."
    For more see this page: About the Add to Library, Import and Convert functions

  • Difference between page file and swap space

    Hello friends
    What is difference between swap space and page file???
    I set the page file to 0 MB(No page file) but when I use Everest Software it show 1023 MB swap Space.Is there difference between them?

    Swapping meaning data in and out from memory ie. primary to secondary. Paging is also the same thing, but its mostly used nowadays as virtual memory is based on pages. So, its like pages in and out. Swap space the memory used for swapping entire processes
    from system memory into the swapfile. Where as paging transfers the pages to page file when the memory is almost full.
    Regarding Everest, I think you should check with the supplier.
    Arnav Sharma | Facebook |
    Twitter Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members
    reading the thread.

  • Difference between .mov files and .dv files?

    I am normally a FCP 4.5 user but I just got the new Macbook Pro and need to capture some footage this weekend using iMovie. Is there any difference between the .mov files we capture with FCP and the .dv files captured with iMovie as far as compression or quality?
    I've looked and looked but can't find the answer. Thanks!
    MacBook Pro   Mac OS X (10.4.5)  

    Hi there. can you explain this a bit more ?
    "you can scrub audio over a .dv clip in a sequence"
    and explain why the .dv video is so doggy in fcp hd?
    so,you CAN NOT convert .dv to fcp - right? or .mov to fcp?- right
    Here is my experience with iMovie, .dv files and
    FCP.
    iMovie can be useful, because it breaks DV clips up,
    and handles time code breaks - by ignoring them!
    I had canon camera, which if I captured with FCP, the
    audio would drift over the hour capture - it was over
    a second out by the end of the tape, so I used iMovie
    instead.
    Dropping .dv files into DV FCP sequences does not
    require a video render or transcode - the original
    image quality is maintained, but will require an
    audio render to stop the audio 'beeping' during play
    back - it seems an arbitrary limitation to me, you
    can scrub audio over a .dv clip in a sequence, and
    you can play audio when the .dv file is in the
    viewer, but not from a sequence.
    Then - it gets more annoying - every edit you do,
    typically requires a re-render of the audio, if you
    don't want the beeping, but there are two tricks
    that can help: 1) make a sequence for each .dv clip,
    unedited, render the audio in that sequence, then
    edit that into the master sequence, or 2) use
    'extract audio' in iMovie, then find the .aiff in the
    Media folder, and replace the .dv sourced audio with
    that in the FCP timeline.
    There is no re-capture, as Shane says, you have to
    stay on disc forever, or risk having to tweak and
    re-trim your project, if you hope iMovie will create
    the same files on a future capture - I have never
    tested that, my guess would be no.
    Most of the folks on the board will dismiss such a
    workflow - and with good cause - but its not totally
    useless, in certain circumstances.
    I have not tried this with the iMovie in iLife '06 -
    so your mileage may vary. Ideally, the beeping audio
    from .dv would be fixed in FCP - I understand it is
    harder to extract and play from a .dv file, but we
    have fairly powerful machines, these days, and,
    iMovie seems to manage just fine
    Good luck!
    iMovie was what got me into Macs in the first place,
    and after my first 'home movie editing appliance'
    (also known as an iMac G3) I started to do less and
    less on PC's, and have not tried to edit video on one
    since.

  • Difference between bad file and discard  file

    Hello everyone, My oracle database is 10g.
    Can any one tell me the difference between badfile and discardfile.(SQL Loader Concepts)

    The Bad File
    The bad file contains records that were rejected, either by SQL*Loader or by the Oracle database. If you do not specify a bad file and there are rejected records, then SQL*Loader automatically creates one. It will have the same name as the data file, with a.bad extension. Some of the possible reasons for rejection are discussed in the next sections.
    The Discard File
    As SQL*Loader executes, it may create a file called the discard file. This file is created only when it is needed, and only if you have specified that a discard file should be enabled. The discard file contains records that were filtered out of the load because they did not match any record-selection criteria specified in the control file.
    The discard file therefore contains records that were not inserted into any table in the database. You can specify the maximum number of such records that the discard file can accept. Data written to any database table is not written to the discard file.

  • Difference between image file and .bin file

    I want to know whats the difference between img and bin file and which is better

    Functionally and generically, they are the same thing for devices like routers and switches and firewalls ...
    Some "images" consist of more than one binary file ... like code for specific blades or modules (like a radio module on an AP).
    In most cases, it's just a naming convention and they are the same.
    For some systems, like computers, a binary file is an executable ... it gets loaded into some flavor of memory, usually RAM, and the instructions are executed. During the initial load, some code is typically executed to initialize the various sub-systems. All of this initialization takes time (think about booting a desktop or laptop computer from power-on to "ready-to-go").
    One way to speed things up a little is to save the initialized environment as an "image" or snapshot of the "ready-to-go" state of the device.
    Once the snapshot is saved, it can be loaded directly into a block of memory without the need of all of the initialization code or interpretation of the binary code. This tends to make things "boot" faster. As long as the system's hardware configuration hasn't changed since the snapshot / image was taken, it should be exactly as if the device was never turned off. Some desktop and laptops have a "hibernate" mode .. everything is powered down, but it boots up as fast as the snapshot image can be pushed into the memory from the hard drive.
    If you have a specific example, post it up.
    Good Luck
    Scott

  • Behaviour differences between  war file and exploded directory

    Hi,
    I'm baffled by differences in how my web app behaves when deploy in a war file and when deployed in exploded directory.
    Firstly when I deploy in exploded directory format (using wldeploy in ant) - the jsps do not precompile. However, when I deploy the war file - again using ant and wldeploy - precompile works just fine - and general performance seems better.
    Secondly - the webapp has a pdf file - which is used as a template to dynamically produce a document. When deployed
    in exploded format - the webapp works fine and is able to read the pdf. However, when I deploy in war file, the pdf cannot be read.
    Surely the behaviour should be the same whether we deploy as a war or exploded.
    Someone please help
    Tariq

    Some behaviors will be different between a WAR file deployment and an exploded WAR deployment.
    With respect to JSP precompile, you just say "they do not precompile", so I can't tell anything about that.
    When you read files from an exploded WAR, you can reference them in two ways: as a resource, or as an absolute file path. When you read files from a WAR file, you can only read files as a resource, and not as an absolute file path. You're not giving any information about how you're reading the file, so I can't tell about that either.
    You'd have to provide more detail to get better answers.

  • Difference between iPhoto Library and Package

    Hi,
       Out for 4 iPhoto libraries on my iMac, only my daughters is shown as "Kind" = "Package".  All others show "Kind" = "iPhoto Library".
    I need to move my daughters Libray to the Mac Mini Server as all or albums are gettnig too big.  All libraries moved ok and working except my daughters.
    When I open the working library packages and compare to my daughters all files look the same. As my daughters library "Kind" is shown as "Package" iPhoto Manager  and iPhoto will not recognise it.  
    My daughter wants me to try to keey all the faces and other tags she's addded to the photos ....
    My Christmas will be **** if I can't solve this and am running out of ideas!   Any and all help welcomed.
    Chris.

    All the folders and files in this "Package" seem to be the same as the ones found in a new "iPhoto Library" I've just created. What am I missing?

  • Difference between *.as file and *.fla

    I saw some actionscripts file ended with *.fla and others with *.as. Are they the same?
    The *.fla files have imports, such as fl.transitions.*, that are not part of Flex.

    Hi again Glen, this tutorial shows you how to import fl.transitions and use this package inside a Flex application
    http://www.flexer.info/2008/06/19/how-to-use-five3d-and-tweening-in-flex/.
    Basically what you need to do is import those clases that belong to Flash so you can use them in Flex.

  • What is difference between UNIX file and DOS file for SAX parser?

    i have the following XML file:
    <?xml version='1.0' encoding='utf-8'?>
    <root>
    <strTask><![CDATA[some
    data on
    multiple lines]]></strTask>
    </root>
    If i save it as Unix file, than SAX parser works correctly and characters() function works only once per strTask tag.
    But if i save the file in DOS mode, then SAX calls characters() function every time new line is encountered during the same strTask tag.
    what can be a clue?

    i have the following XML file:
    <?xml version='1.0' encoding='utf-8'?>
    <root>
    <strTask><![CDATA[some
    data on
    multiple lines]]></strTask>
    </root>
    If i save it as Unix file, than SAX parser works
    correctly and characters() function works only once
    per strTask tag.
    But if i save the file in DOS mode, then SAX calls
    characters() function every time new line is
    encountered during the same strTask tag.
    what can be a clue?

Maybe you are looking for

  • How to tune performance of a cube with multiple date dimension?

    Hi,  I have a cube where I have a measure. Now for a turn time report I am taking the date difference of two dates and taking the average, max and min of the date difference. The graph is taking long time to load. I am using Telerik report controls. 

  • Importing a class

    Does importing a class result in creation of class file for that class. import somePackage.B public class A{ Does compiling class A result in creation of B.class

  • Message Server Port and Instance Number

    Hi All, I need to create Technical System and Business System in SLD for my IDOC-XI-FILE Scenario. There i need to specify the Message Server port under Message Server and Instance Number in Central Application Server. Please let me know where i have

  • Background color question..

    I can't for the life of me figure out how to add or change the background color on any pages I create. There is nothing I can find in the inspector, such as Iweb has, for the entire page to have a certain color. For example, if you try the "for sale,

  • Where do I go to buy new Mac OS X Installation disks?

    Our beautiful little Labrador Retriever helped herself to my Mac OS X Installation disks (and my credit card, driver's license, and wallet). I've been on Ebay and Amazon. There is one selling on ebay for the 10.5.2 but our iMac is 10.5.8. What will w