Jar file compression - to do or not to do

2 quick questions for the jar gurus out there...
I have several jar files:
1. a jar file for my app itself
2. a common jar (shared generic libraries for all my apps)
3. a common db jar (shared db libraries for all my apps + mysql drivers)
4. a misc jar (stuff like java help and GUI calendar classes)
The way I see it, I have several choices:
1. leave the jars seperate and leave uncompressed
2. leave the jars seperate and compress them
3. combine them all into one jar and compress the entire archive
4. combine them all into one jar and leave them uncompressed
I realize that smaller jar size is good if users are downloading the jar but this application is run from the local drive, not from the web, so fast download times are not important to me.
My questions are:
1. Is there any benifit to compressing a jar other than fast download times? (I assume the answer is no).
2. Is there any benifit to combining the jars?
I'm thinking that having a combined jar might make installations easier, but future upgrades might be easier with multiple jars (if just the common jar changes for instance...)
In particular, I am wondering about application startup time and total memory usage, is there a difference in these areas from how the jar is packaged?
I look forward to any feedback you all can provide.
Cheers,
Andy Dingfelder

When everything is running well is the time to update.
Updating when your Mac is having problems is a recipe for disaster and then you arrive at this worldwide online hospital for sick Macs
Back up > Remove iPods, spare HDs and assorted peripherals > Download Combo updater from Apple > Restart > Then install and be patient through two Automatic restarts.
No problems here.

Similar Messages

  • JAR files under WEB-INF but not in lib directory

    I am working with JDeveloper 10g and I have several jar files under WEB-INF/lib and other under WEB-INF/libEst.
    I have add this libraries to Project properties > Paths and it works fine when I run my aplication in local environment, but it fails when I deploy and run in the server.
    I have configured our deploy file to include these WEB-INF/libEst jar files, but when I deploy to our server, it seems to be that this classes included in these jar files are not reachable and they cannot be loaded and throw a ClassNotFoundException.
    Is it possible to have jar files under any WEB-INF subdirectory distinct of /lib?
    Why is it working in local but not in server?
    If someone can help me to configure this in order to deploy in server, I will be very grateful.
    Thanks a lot,
    Antonio.

    Hi Antonio,
    I think this document is what you are looking for: http://www.oracle.com/technology/tech/java/oc4j/htdocs/how-to-servlet-warmanifest.html
    .. your manifest entries would look like
    Class-Path: WEB-INF/libExt/<jarName1>.jar, WEB-INF/libExt/<jarName2>.jar, ...
    Let me know if this works for you.
    thanks,
    Harsha

  • Little Mailprogramm works in JBuilder but do not work with a JAR File

    Hallo !
    The application works in JBuilder, but if I make an archive it dont work. If have included "JavaMail" and "JavaBeans Activation Framework". (same as in the JBuilderProject)
    The Error Message is:
    class javax.mail.MessegingException: IOException while sending message; nested exception is:
    javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed;
    at javax.mail.Transport.send0
    at javax.mail.Transport.send
    I have other applications which work on JBuilder an as Jar-File, but why this application not ?
    I have JBuilderProfessional in use.
    Are there some licenceproblems with "JavaBeans Activation Framework".
    Please help me.
    Thank you !
    Wolfgang

    I think I have found a solution here:
    http://forum.java.sun.com/thread.jsp?thread=74127&forum=43&message=519108

  • Runtime.exe() is not working from within a jar file.

    Hi All,
    I have a jar file which have classes and a package in it.
    One of these classes is calling another class which is present in the package.
    The code i am using it is as follows:
    Runtime r=Runtime.getRuntime();
    Process p=null;
    p=r.exec("java deep.slideshow.PlayShow");It is working fine when i am executing it without making jar file.
    But when i make a jar file of all these things , this exec() is not working.
    I have tried a lot.
    If any body has any idea suggest me.
    Thanks

    thanks a lot for your reply friend.
    I tried the same you tell me to do by using the cmd;
    java -cp my.jar package.class  And then tried to make the jar file with the help of eclipse,
    after adding my jar file into classpath of my project in eclipse.
    Its working fine on my local system.
    But when i put this jar file on some other system it does not call my jar file(obviously bcz it will not the find the jar file according to the classpath set on my local system. )
    Is there any way that i can keep this jar into my project and then can give the classpath dynamically
    so that it can pick the file from my project automatically.?
    Later on i will pack this whole thing into a full jar file and it will work on a single click.
    Is it possible or not ?
    Please suggest me.
    Thanks

  • How to list files that are NOT in a .jar file?

    Is it possible to list files (resources, .gif/.jpg files, etc.) that are NOT included in the jar but are still to be considered part of the application somewhere in the jnlp-file?
    My applications requires lots of icons which I have put into .gif files. So far I kept them in individual files next to the .jar file and that worked fine.
    JWS now seems to support only stuff that is included in (a) .jar-file(s). That in itself woul not be much of a problem, however, when I include my .gif files into the .jar files they seem to get corrupted by the jar-signing process (at least that what's the code says, which can suddenly not handle these images any more).

    My previous seem to have been non-sense. The .gif file were not corrupted, but rather they were not found at all. They actually must NOT be included in the .jar file, or else they are not found. Strange enough, the .properties-file seemingly HAS to be in the .jar file to be found.
    This is something I'll probably never fully understand with java: which file-types it searches where...

  • Java 5.0 does not recognize wrapped Class-Path in Manifest.MF of .jar file?

    Java: build 1.5.0_05-b05
    Ant: 1.6.2
    I use Ant <jar> task to create a standalone application in a .jar file. I have a very long "Class-Path" in the Manifest.MF file. The long Class-Path is wrapped at every 70th character by the <jar> task. I cannot run "java -jar <the jar file>", because Java runtime cannot find classes.
    I found the following Q&A from ANT's FAQ page,
    Q: Whenever I use the Ant jar or manifest related tasks, long lines in my manifest are wrapped at 70 characters and the resulting jar does not work in my application server. Why does Ant do this?
    A: Ant implements the Java Jar file specification. Please refer to the notes section where it discusses the maximum allowable length of a line and the concept of continuation characters.
    If a jar file produced by Ant does not work in your appserver, and that failure is due to the wrapped manifest, then you need to consult your appserver provider, as it is a bug in their appserver. Far more likely, however, is a problem in your specification of your classpath. It is not Ant's wrapping of your classpath that is the problem.
    Do not raise a bug about this issue until you have checked to ensure that the problem is not due to your classpath specification.
    Any idea?

    "will be searched ALSO."...
    From: http://java.sun.com/docs/books/tutorial/ext/basics/load.html
    Understanding Extension Class Loading
    The extension framework makes use of the new class-loading mechanism in the JavaTM 1.2 platform. When the runtime environment needs to load a new class for an application, it looks for the class in the following locations, in order:
    1. Bootstrap classes: the runtime classes in rt.jar and internationalization classes in i18n.jar.
    2. Installed extensions: classes in JAR files in the lib/ext directory of the JRE.
    3. The class path: classes, including classes in JAR files, on paths specified by the system property java.class.path. If a JAR file on the class path has a manifest with the Class-Path attribute, JAR files specified by the Class-Path attribute will be searched also.
    [snip]

  • Help me this error :"uncaught error fetching image" with Jar file

    Hi all.
    I have a program written with Swing. This program has one button and fetch Image into this button. Image is in Images directory .When I run this program by IDE, It's OK. However, when I compress classes of this program into Jar file and run, it can not recognize the path to Image. And it leads to this error:
    "uncaught error fetching image"
    I have tried to look for a lot of information relating to this problem on the internet but nothing is possible.
    Please help me. Thank you.
    And my program
    http://www.mediafire.com/?j0yzun4d0mx

    When you JAR it's different. Try something like this:
    BufferedReader br=new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(listname)));
    you don't hae to do the BufferedReader, but the getClass().getResource... is what you need.

  • How to build a jar file so the program can access its resources folder?

    I have a java program written by someone else in which I have made a trivial change (I changed the background color). The jar file runs but it does not find one of the resources file.
    Here is the project folder's structure
    mainClass.txt (manifest text file)
    folder resources (includes file Java does not find: order.txt, a text file)
    folder CFPT ( includes .class files)
    folder cpl (includes .class files)
    folder results
    I tried
    jar cvmf mainClass.txt CFPT0.jar CFPT/*.class cpl/*.class resources results
    I get a lot of "adding: resources/..."
    including the one pertaining to the files which is later not found
    adding: resources/order.txt(in = 411) (out= 169)(deflated 58%)
    the code that chokes right now is the following,
    Object i = new Object();
    InputStream is = i.getClass().getResourceAsStream("/resources/" + resourceName);
    when I run java -jar CFPT0.jar the program runs
    but it soon gives an error, cannot find resourceName order.txt (is == null)
    I have Core Java Volume 1 page 498 but it does not help me figure out what I am doing wrong.
    Can somone help me build the jar file correctly so the program can find its resources?
    Is this a classpath issue? What do I need to do?

    My last mainClass.txt file content:
    Main-Class: CFPT.CFPTRunner
    Class-Path: ./resources ./results
    I also tried
    Class-Path: resources results
    Initially I only had the first line.
    I put back /resources in the java file as the / is necessary to indicate absolute path.
    Otherwise it looks relative to calling class.
    I tried adding the path on the second line of the manifest file per Wikipedia example
    http://en.wikipedia.org/wiki/Classpath
    I looked at
    http://java.sun.com/javase/6/docs/technotes/guides/lang/resources.html
    If you use the -sourcepath option, the compiler searches the indicated path for source files; otherwise the compiler searches the user class path both for class files and source files.
    http://java.sun.com/javase/6/docs/technotes/guides/lang/resources.html
    resources
    I took out the -d classes and compiled the .class files right with the java files in case that was the problem
    javac -classpath . CFPT/CFPTRunner.java
    jar cvmf mainClass.txt CFPT0.jar CFPT/*.class cpl/*.class resources results
    java -jar CFPT0.jar
    Still no go

  • OutOfMemory Exception while running a JAR file

    Hi,
    I am working with Java 1.5 and using Eclipse to build a GUI. My application has intensive image loading involved so I set -Xmx inside Eclipse when running the application in debug mode.
    However, once a JAR file is exported, I do not know how to specify the heap size required to run the program. Is there a way to ...
    1. embed the heap size info inside the JAR file?
    2. specify a heap size when running the JAR file?
    Thanks in advance.

    Heap size is specified by the -Xmx option on the java command. See the java command documentation.

  • Including helper classes in java proxy jar file

    I must not be using the right header search criteria because I'm sure this question
    has been asked before. In a Web Service File (.jws) I've imported a couple of
    helper classes that function as data transfer objects. I did this to maintain
    consistency with other portions of the application. The Java Proxy jar file generated
    by Workshop does not include these files. Is there a way of including these dependencies
    or do I need to distribute another jar file with my helper classes?

    Hi Naichen,
    I was able to successfully run both the autotype and clientgen Ant task, on the
    WSDL you provided. The code behind those Ant tasks are pretty much what the WebLogic
    Web Services test page run. Are you using WLS 8.1 SP2? If not, you might want
    to try with that version.
    Regards,
    Mike Wooten
    "Naichen Liu" <[email protected]> wrote:
    >
    >
    >
    Hi,
    I am having a warning message when trying to generate java proxy jar
    file on weblogic8.1
    webservice test web app, the message is as follows:
    "Warning Failed to generate client proxy from WSDL definition for this
    service.
    Prescription Please verify the <types> section of the WSDL."
    in the mean time, on weblogic starting terminal, I saw the following
    exceptions,
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\AlphaLength4Deserializer.java:36: cannot resolve symbol
    symbol : class FacetUtils
    location: package binding
    weblogic.xml.schema.binding.FacetUtils.checkLengthFacet(__typed_obj,4L);
    ^
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\OSIFieldAnonTypeDeserializer.java:36: cannot resolve
    symbol
    symbol : class FacetUtils
    location: package binding
    weblogic.xml.schema.binding.FacetUtils.checkMaxLengthFacet(__typed_obj,69L);
    ^
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\AlphaLength2Deserializer.java:36: cannot resolve symbol
    symbol : class FacetUtils
    location: package binding
    weblogic.xml.schema.binding.FacetUtils.checkLengthFacet(__typed_obj,2L);
    ^
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\FreeFormAnonTypeDeserializer.java:36: cannot resolve
    symbol
    symbol : class FacetUtils"
    Can anybody help me about this issue? I attached WSDL file, also United
    Airlines
    got an enterprise weblogic license deal with BEA, any help will be highly
    appreciated.
    Thanks!!!
    Naichen

  • Extract JAR file to a different directory

    Is it possible to use the jar command to extract the content of a JAR file to a different directory (not the current directory)?
    I want to use this command inside a makefile, looking for the same effect as "unzip example.jar -d directory".
    Thanks in advanced.

    Thanks Chuck, you solved my doubt... It surprises me that JAR doesn't support this option.
    I used the "unzip" command inside the makefile instead, but I wanted to be sure that there wasn't any chance to use "jar" (without using the additional script file).

  • Add classpath in an executable jar file

    an executable jar file contains a manifest file with entry main-class: MyApplicationClass.
    if we double click the jar file on Windows OS, main class is loaded.
    my question is:
    if classes in he jar file use classpaths which are not default, how to add those classpaths into manifest file to tell classes to use those classpaths?
    it is similar to command line:
    java -classpath c;\mypackage; .......; MyApplicationClass

    Thanks, i will try soon.
    here is another Q.
    if i need to add tools.jar (JDK lib) as classpath in manifest file, it is as following in my PC
    d:\install\java\jdk14101\lib\tools.jar.
    but my customers install JDK in different path (should be considered as unknown), how to add it as entry Class-path for all customers?

  • 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>

  • Don't know how to make my main class import a jar file

    OK, the title doesn't make much sense but here are my create-jar.bat and manifest files:
    create-jar.bat:
    jar cvmf manifest.txt dassimul-admin.jar player/ admin/ com/ connector/ common/ *.class
    manifest.txt:
    Main-Class: admin.DASAdmin
    the problem is that in connector/ folder there is the jdbc mysql connector driver (.jar file).
    in Eclipse I can add this jar to the Java Build Path, so the program runs.
    When I double-click the dassimul-admin.jar file, I get a Class Not Found Exception
    C:\MYWORK\dassimul>java -jar dassimul-admin.jar
    FATAL ERROR WHILE LOADING SQL DRIVER: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    I think that the problem lies in the fact that admin.DASAdmin can't see and import the jar file in connector/ folder... am I right?

    It looks like you are putting the mysql jar file inside the dassimul jar. That won't work unless you write custom code. You should use the Class-Path attribute of the manifest to define a relative path(s) to the other jar(s) that you need to use.
    [http://java.sun.com/docs/books/tutorial/deployment/jar/index.html]

  • How to make jar files at runtime in a server application

    I am using Jung API and i need to load the class files in this JAR file for my application at runtime.
    I am using an applet which uses this API which is loaded with the help of a Servlet.
    The code is getting compiled but the JAR files and associated classes are not available at the runtime
    How to make themk avalable.
    I have tried various options like placing jar files in
    WEB-INF/lib
    $Catlina_Home/commons/lib
    But it is not working can anyone help me it is of high urgency to me
    How to make that classes in the JAR file available to my applet at runtime

    SuperJavaHello wrote:
    How to make that classes in the JAR file available to my applet at runtimeAhh! The runtime is an appler! The applet is on the Client, and the Client does not have access to the Server's classpath. You need to un-pack the JAR, then re-pack the classes into the JAR used to pack your Applet, the one that you are using as the code source in the applet tag.

Maybe you are looking for

  • ASA SSL VPN not working

    Dear Sir, I have a windows 2003 server and an ASA 5512 I'm trying to use SSLVPN and it was all working, and I don't believe any configs on either box have been changed. On Friday people were connecting, but now I get a message "Login Error" in the br

  • Moving bars In score

    Anyone else having problems moving bars downward in the score window. It seems they only go up even when you grab and pull them down. I've set the max limit in score preferences. Perhaps just another score bugger in 8.01.

  • Mega Sky 580 - Crashes

    I have problems getting the card to be stable. If I start and close the program several times my machine reboots with an "error caused by a device driver". If I just let Presto PVR run it crashes the application after some time. Actually we are 4 peo

  • Add a wifi client to Time Capsule

    How can I add a client to my Time Capsule 1st generation wifi network, using mac os.x 10.8.3 ?

  • How can I get new windows to open On Top Of the current window, not Behind the current window?

    Regarding the Options checkbox to "When I open a link in a new page, switch to it..." I already have that box checked, but still windows are opening behind my current window.