Binary JAR file format

Hi out there,
does anybody know where I can find the specification for the binary JAR file format?
It doesn't follow the ZIP spec, there must be some additions.
Here is my problem:
I'm reading the 1. local file header, there compressed and uncompresed size is 0. Bit 3 of the
general purpose bit flag is not set so there is no Data descriptor section and there should also be no
file data section (size is 0, extra field also 0). But there are still some
bytes until the next local file header starts. What are the bytes in between??
Somewhere in the middle of the 2 local file headers is the 0x08074b50 signature, which is mentioned
in the zip spec in combination with Spanned/Split archives !??
If I'm reading a ZIP file generated with WinZip it is working fine, but when I'm reading a jar generated with
the jar tool there are this mysterious bytes, which I cannot interpret.
Thanks in advance for your help.
Cheers,
Steffen

okay, guys just in case someone is interested (doesn't seem like, but anyhow):
YES, the jar tool is not sticking exactly to the zip specification. I found out when I was
browsing through the source code of the java distribution. The local file headers are not
filled with the size information!
Quote: * We'd like to initialize the sizes from the LOC, but unfortunately
* some ZIPs, including the jar command, don't put them there.The solution for it, which I think is the standard for zip processing anyhow, is reading the
central directory of the zip file first. There you get all info including also the size, etc. of the entries
and also the offset to the local file header.
The drawback is that it's a little more complex to read a file from the end and not from the beginning
because you have to find the beginning of the central directory first, but well ...
Okay, that's it. Have fun!

Similar Messages

  • How to install a Application in *.jar file format?

    How to install a Application in *.jar file format?
    I have taken the *.jar file into the device into media folder. but device is not recognizing the file format
    could some one plz provide some suggestion to proceed with this?
    Thanks
    Mohamed Javeed

    I'm having the same problem.  I've put .jar into the 'system' folder but that doesn't seem to make the program work neverless see it on my device.  Help.

  • Binary Jar file?

    How can we create binary Jar file in order to hide the code from the client?
    Note that: The .xml and .html files are accessible/understandable in Jar file. I need somehow hidden this codes when deploy it.

    Still couldn't find a solution for this.(Also review other fourms). Would appreciate any command on this.

  • JAR file format

    Hi,
    I need to write a C program to retrieve class files from a JAR file. Can anybody point me to any resource that explains the format of a JAR file. Basically, I need to write my own "unjar" utility. Any help would be greatly appreciated. Thanks.
    CharithaT

    A JAR file is simply a ZIP file. zlib will do the decompressing for you!

  • Write file in jar file format

    Hi all,
    I have bundled my programs and xml files in the same jar. In my program, I want to update the xml files. How should I do it? I have used JarOutputStream before, but it fails...
    Thanks a lot!
    Best regards,
    Ray

    But why the API has the JarOutputStream and ZipOutputStream? Could we use these to update the files in a jar archive??
    Thank a lot ^_^
    Hi all,
    I have bundled my programs and xml files in thesame
    jar. In my program, I want to update the xml files.
    How should I do it?You can't update files in a jar archive. If the XML
    files are to be updated, don't put them in the jar.

  • I would like to know how i can save an byte array to a mat file format (matlab file format '*.mat') within to use the matlab API

    So, I search the binary matlab file format('*.mat').

    Title:
    Moving Data Between MATLAB® and LabVIEW
    Problem: 
    How can I share data between LabVIEW and the MATLAB environment?
    Solution: 
    MATLAB users can move data between the
    MATLAB environment and LabVIEW, you have several options. Prior to
    LabVIEW 5.1, the only way to transfer data between these two
    environments was to use the Save and Load functions. Those are discussed herein.
    Beginning
    in LabVIEW 8.0, MathScipt was introduced. MathScript is an integrated
    part of LabVIEW that you can use to combine intuitive graphical
    dataflow programming with math-oriented textual programming. See the
    attached links below for more information on MathScript.
    Beginning
    in LabVIEW 5.1, the MATLAB script node was introduced into the LabVIEW
    programming environment. The MATLAB script node makes ActiveX calls to
    the MATLAB software from within LabVIEW. This requires that both MATLAB
    be installed on the same machine and that a valid license is obtained.
    More information on the MATLAB script node can be found in the attached
    KB's.
    For all versions of LabVIEW, this data transfer can be
    performed by saving the data in a file using the MATLAB software and
    reading it directly from LabVIEW, or vice versa. In the MATLAB
    environment, the command "save" allows you to save the data in
    binary format (*.mat) or ASCII format. You also have an option of
    saving it in ASCII format using a tab delimiter between data points and
    the command "load" allows you to read in the data.
    ASCII Format
    Complete the following steps to import or export data between LabVIEW and the MATLAB environment using an ASCII file format.
    From the MATLAB environment to LabVIEW
    To save a vector or a matrix X in tab-delimited ASCII format, enter the following in the command window or m-script file in the MATLAB environment:
    >>SAVE filename X -ascii -double -tabs
    This creates a file named filename containing data X in tab-delimited ASCII format.
    Import the file into LabVIEW using the Read From Spreadsheet File VI located on the Functions»File I/O palette.
    From LabVIEW to the MATLAB environment
    To export a matrix X from LabVIEW to the MATLAB environment, first save the data in ASCII format in LabVIEW using the Write To Spreadsheet File VI on the Functions » File I/O palette.
    Enter the following in the command window of the MATLAB environment, or in the m-script file:
    >> LOAD filename
    This reads the data into the MATLAB environment.
    Binary Format
    Complete the following steps to import or export data between LabVIEW and the MATLAB environment.
    From the MATLAB environment to LabVIEW
    As mentioned above, LabVIEW does not save multiple variables to one
    data with extra manipulation, and will not be discussed here.
    Therefore, the only way of sending the data from the MATLAB environment
    to LabVIEW without tampering with the MAT binary file structure is
    using the ASCII format. Also, please bear in mind that you need to have
    one file for one variable.
    From LabVIEW to the MATLAB environment
    Because
    the MATLAB software saves data in its own binary format, the "MAT"
    file, binary LabVIEW data must be converted to this format prior to
    transferring the data. The attached examples can be used to save
    LabVIEW data in the MATLAB software format. The convenience of the .MAT
    file format is that more than one variable can be saved in the same
    file. The example shows saving seven variables to .MAT format; the
    example can be modified for any number of variables.
    Once this data is saved from LabVIEW, it can be read into the MATLAB environment, using the following command:
    >>LOAD filename
    The Who
    command can then be used to display all the seven variable names, and
    you can display the content of them by entering the variable names at
    the command prompt as usual.
    MATLAB® is a
    registered trademark of The MathWorks, Inc. Other product and company
    names listed are trademarks and trade names of their respective
    companies.
    | Michael K | Project Manager | LabVIEW R&D | National Instruments |

  • How do I prevent Spotlight from categorizing 'JAR' files as 'Application'

    I'm a java developer and consequently I have a lot of JAR files on the filesystem. The JAR file format is a standard archive format for java, and is used mostly to package library code - the java equivalent of a DLL. They can also be created as 'executable JAR's, but this is (very) infrequent compared to the library usage.
    Spotlight seems to think every JAR file is an application, and because I have a lot of java applications and development stuff installed, I can no longer reliably use Spotlight to find actual applications because the search results are overflowing with useless JAR file entries.
    Is there any way to configure spotlight to not classify JARS as applications? Or, alternately, can I make Spotlight ignore JARs completely? Either would save me a lot of time..
    /Bill

    There are several things in the current version of Spotlight that are either broken or just plain wrong. It looks like you have found another. When I look at the metadata for a jar file I see that its type is, well, a java jar file, and its content tree declares it to be a com.sun.java-archive. Finder gets this right: if you do GetInfo on such a jar file its kind is shown as "Java JAR file"--as it should be.
    When I made a saved search, using the Kind drop-down menu to get the pre-defined Application, and then looked to see what criteria Spotlight was using to define "application" (and yes, the search included jar files in its results), I discovered Spotlight was NOT using the simple, straightforward "kMDItemKind=Application" as one would expect. Instead it is using something I had never heard of to define an Application, to wit "_kMDItemGroupId = 8"--furthermore, I believe characterizing applications that way has been deprecated. Be that as it may, it doesn't work to find the things you want, and exclude the things you don't.
    There is no way for a user to fix this. The only thing you can do is not let Spotlight define the kind. Thus, if you bring up a search window do not use the Kind drop-down menu to select Application. Instead select Other from the menu and then type Application. You then get only things whose type declaration is Application, and you don't get jar files or widgets.
    The other option is to exclude jar files by typing
    NOT jar
    in the search for box (you'll still get widgets though). You can also add that boolean restriction if you are using the menu bar Spotlight search.
    Francine
    Francine
    Schwieder

  • How to use packages and jar files for applet?

    Hi!
    My applet takes a class say a.class.
    Now this class depends on other classes that are packaged
    in a directory and put separately.
    I want to put this applet on the web.
    So how do I manage the .class files in he package.
    I have tried using jar file format.But I was not able to get it working.
    Can someone please help me?
    Thanks

    Use Archive instead of codebase:
    <APPLET CODE="MyApplet.class" ARCHIVE="MyApplet.jar" WIDTH=400 HEIGHT=300></APPLET>

  • Can I place jar files inside ejb-jar.jar?

    Hi,
    I'm reading about the packaging rules for creating an ejb-jar.jar file, and I'm wondering whether it's possible to include a jar file (containing helper classes) inside of the ejb-jar file. A "lib" dir (for containing such helper jars) doesn't seem to be part of the ejb-jar file format.
    The EJB 3 spec has this to say (Ch 20, "Enterprise JavaBeans 3.0, Final Release):
    "The ejb-jar file must also contain, either by inclusion or by reference, the class files for all the classes and interfaces that each enterprise bean class and the home interfaces, component interfaces, and/or web service endpoints depend on, except Java EE and J2SE classes. This includes their superclasses and superinterfaces, dependent classes, and the classes and interfaces used as method parameters, results, and exceptions"
    Now, it seems that the root of the the ejb-jar file contains all the classes (in the appropriate Java package layout). But what about including JAR files? The ejb-jar spec seems to have nothing to say about a "lib" dir that can contain jars (as a WAR file can).
    Summary of questions:
    1) Can an ejb-jar file contain a jar file? If so, how/where?
    2) Can the ejb-jar file's META-INF/MANIFEST.MF file contain a reference to a JAR file?
    I'm not considering correct design at the point... I'd just like to know if these 2 scenarios are possible.
    Thank you!
    kamuifx

    Yes, I have an ear file..................
    I have an EAR file; inside the EAR I have a WAR file (web module) and an EJB-jar file (EJB module).......... the EJB need some classes placed in a jar file (a helper .jar or an util .jar)...........
    my question is: How can I use the classes of the .jar files in te EJB??????
    thanks

  • Jar-files with vm-arguments

    Hi,
    If I run the junit-tests in eclipse then there are no problems. When I run in jar-files format then it need the vm-arguments(Exception:Arguments not set). How can I pass arguments the my jar-files?
    Thank you.

    Hi everybody,
    I happy, that I'm not the only one suffering from this limitation. Right now I'm writing a Java application which will be used not only by persons who have Java experience. I guess most of them wouldn't even know how else to start it than double-clicking on the jar-file. And in my opinion, that's perfectly alright! When starting an native executable, you also don't think about defining a maximum heap size and even non-developers can easily use these applications. But I don't what to start if native applications are better or not. I really love Java and I don't want to miss it, that's for sure.
    But I don't understand, why on the one hand Java tries to "sell itself" as a real alternative to native applications and one the see the intention to let Java applications more and more "feel" like them (e.g. with introduction of features like TrayBar support or making it easy to open/edit/... files with any application assigned to that file type), but on the other hand there is no official way to easily setup the environment to start these Java apps. I mean, you can use Applets or the WebStart facility for deployment, but that can't be the right way! I can think about so many applications which I would really like to have as a real offline tool. What is, if the PCs I want to use my app on don't have an internet connection?
    Ok, but to make a long story short, I'm really looking for any way to make it easy for the users of my application to "just use it" rather then telling them when how to increase the maximum heap size or which script they have to use to run it. And the only way I see right now is the idea of using a wrapper just for starting a new VM with additional parameters. Even this is a bad hack in my opinion, but I'll try if this is useful for me.
    Anyway, I hope that maybe someone already found a better solution cause I can't believe that this problem is really uncommon.
    If I find a better solution I'll let you know.
    Regards,
    Black Widow

  • Format of jar file

    i need to know format of jar file, from buffer's view.
    i.e. zip file is in format of structs: local_file_head, central_file_head etc (in c/c++ sense).
    jar file should have similar format (a set of structs), but i can't find any info about it.
    thx for any hints, links ...

    >
    Presumably u don't know both jar and zip file format.
    Best of luck to you then, if it isn't too much trouble could you post back when you find your answer and enlighten us as to what the differences are in physical file layout between the jar file and zip file? I, for one, would be most interested in your findings. It's obvious that we won't be able to help you with this, but maybe you could help the folk who come here looking for this answer.
    same? what does "same" mean?Main Entry: 1same <http://www.m-w.com/images/audio.gif>
    Pronunciation: 'sAm
    Function: adjective
    Date: 13th century
    1 a : resembling in every relevant respect b : conforming in every respect -- used with as
    when i load jar file, it is totally different from zip
    file in formatCare to expound on the differences? That would be most educational. Though it's odd, since, presumably you know that there are differences, and if you know what these differences are, that would be the answer to the question you originally posted.
    Presumably i know zip file format.
    Presumably u don't know c++ at all.
    You are operating under pretty slim evidence to make such a statement, but, since it's relevance to this forum is pretty much nil, I suppose that sort of shoddy thought isn't too damaging to your central point.
    Lee

  • Binary file format

    Hello!
    What is the binary file format for files created by Labview's example High
    Speed Data Logger? The header information comes first, but how is the actual
    logged data written in the file? I have logged two channels.
    Thanks in advance for advice.
    Best regards,
    Antti Ryhänen

    The LV code first converts the I16s to U16s and casts it as single-precision floats. It them multiplies the result by a scaling factor that's stored in the data header and adds an offset that's found in the same place.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Which data file format is better for storing setup information? XML, ASCII or Binary?

    Hello,
    Our application is using cluster, string, Integer and other data types and storing them in ASCII files.  We are using flatten to string function and storing it to the text file.  However, going ahead we want to migrate to XML file format.  Is it a good idea?  What would be the pros and cons?
    Thanks.

    If you are using LabVIEW's Flatten to String function, you are storing your data as binary, even if you are sending a string to the file writer.
    The issues you will run into using this method or any of the canned LabVIEW XML VIs:  If your data type changes, your files can't be read in any more.  You mentioned you have clusters.  If you add an element or take one away, the old files won't be read in anymore.  You would have to store old versions of the data type and file reader and then convert the old data type to the new data type.
    The nice thing about OpenG's INI functions is they take variant's, so you can pass complex data structures and it will write the file.  If the data type changes, as long as it can be coerced into the format, it will still be read in.  If you pass a cluster and a value is missing from the INI, the default is used.  If there is an extra value in the INI, it's just skipped.  So, your reader and writers can be updated without as much concern about supporting old data files.
    One method you can do if you want to use binary is the "TLD" method.  TLD stands for Type, Length, Data.  I use an enum for the Type.  The Length is just the length of the Data which follows, and then the data is the binary data.  If I change a data type, then I create a new enum value (always has to be added to the end of the list to maintain value consistency with the old files).  This way, the reader can still handle the old data type and convert it into the new data type in whatever method is necessary.  It can also completely ignore it if desired.  I usually process clusters as individual items so I don't have to save old versions of the cluster.  It works quite well and only adds a few bytes per data item.  The big caveat is you have to remember to update your file writer and reader whenever you change a datatype or add a new value.

  • Read doc file using the Word Binary file format

    I want to be able to parse a Word file (xyz.doc).I want to be able to get to the actual text in the file and also get the "document properties" associated with this file.(This is the stuff you enter when you hit the File>>Properties button in Word)
    I have the binary file format of MS word 6.0 and I suppose these "document properties" are stored within a segment in this file format.
    Can anyone help me identify which segment in the Microsoft Binary word format this will be in???
    (Ya and ofcourse I want to achieve all the parsing purely in Java!!..)
    Thanks,
    Supriya

    IF you use MFC, yes. Don't ask how, this is the Java
    forum. As to the JAva API, no. There is no API in Java
    to deal with Microsoft docs, this is Java, not
    Micorsoft. Ya I know that!!:P
    You can write your own code, using the
    information in the doc. The info you refer to is
    locted on the header portion. As to how to read it,
    best go to a Microsoft forum. Once you understand the
    format, then post any Java related questions here,
    i.e. how do I oppen a file to read/write etc. Good
    luck, you will need patience, but you will leran a
    lot...Thanks anyway for your reply!:)..Will try with patience

  • Jar files required to read excel file in SAP PI 7.3.1 sp09 dualstack

    Hi experts,
    I need to read excel file (.xls) using SAP PI and process it to target system. I have read blogs
    and found that there are 2 ways to read an excel file in PI using file adapter.
    1) Developing a custom adapter module
    2) Using XSLT code.
    So in order to develop a custom adapter module, i have followed the following blogs
    **************** - XI - Step-by-step guide to develop Adapter Module to read Excel file
    and
    Excel Files - How to handle them in SAP XI/PI (The Alternatives)
    and
    http://wiki.scn.sap.com/wiki/display/ABAP/Adapter+Module+To+Read+Excel+File+with+Multiple+Rows+and+Multiple+Columns
    I am unable to find the jar files in SAP PI at OS level as per the first blog(think they were obsolete).
    Please let me know
    1) What are the required jar files needed to read excel file and their location
    2) Even if i use the old jar files as mentioned in the first blog can i achieve my requirement
    3) Following this blog Convert incoming XML to Excel or Excel XML – Part 1 - XSLT Way if i apply the same logic at sender side, will it work? Because through case studies i came to know that we cannot read a .xls file using XSLT code. Correct me if i am wrong.
    Looking for your valuable suggestions.
    Regards
    Shilpa

    Hi Shilpa
    Welcome to SCN!
    The blog you refered to might be for previous versions of PI. You can refer to the following two wikis to find out what are the relevant JAR files for PI 7.3 and also how to get them.
    XI libraries for development - Process Integration - SCN Wiki
    Where to get the libraries for XI development - Process Integration - SCN Wiki
    It also looks like for newer versions, you might not need to manually get and add those JAR files into your NWDS project - please refer to the first comment on the blog below. I have not tried it personally as I'm not using the latest NWDS, but you can try that first, and if it does not work, then go get them manually.
    PI 7.4 - Adapter Module Creation using EJB 3.0
    Do note that you should be using the JAR files that is corresponding to your PI server version.
    As for your third question, that does not apply to you. XLS is the older non-XML format, and therefore cannot be read by XLST since it is in binary format.
    Rgds
    Eng Swee

Maybe you are looking for

  • Last Data Update in Visual Composer and Web App Designer

    Hello, We want to show the last data update in query result and we used 2 differents ways to do it: throught Web Application Designer (SP 12) and Visual Composer (SP 10). In query result of Web Application Designer, the last data update came in GMT0

  • Linksys E4200 is not channel bonding

    I have been trying for weeks to figure out why my linksys E4200 would not do 300 mbps I think I came up with the answer the firmware is not allowing it to channel bond on the 2.4ghz channel  in my old 160n when I change the channel width to 20 to 40m

  • Changes made to files are not reflecting

    File updates not reflected. I modified content, added data validation and saved the file back - next day file is still the way it was before modification. Other file, another site but similar situation. Content changed - form added but next day the c

  • Early 2009 Macbook display problems

    I have a early 2009 macbook (aluminium). when i try to turn it on all that comes up is a lit up black screen, as if it is on but nothing happens. i went in to an apple store and he connected it to an external display but still nothing happened.Please

  • Is it possible to set up a Paragraph Style leaving the Font Style field blank?

    We often have to import text into InDesign from Word docs. We place the docs (Command-D, rather than copying and pasting) in order to preserve italics, bold text, etc. As it is now, we have to select all the text and set each element separately - lea