JAR file decompressed before run?

hi,
does anyone know if a JAR file is decompressed totally to some temporary location before it is run? So if you had a 1Gb Jar file that was mostly odd files, and a few java classes to do some optional processing which never occured, would the remainder of the jar be decompressed?
thanks,
asjf

Oops, wrong answer to wrong thread.
Jars a decrompressed on demand but the JRE might cache the whole Jar file.
But anyways: Who uses such big Jar files?

Similar Messages

  • How can I create a jar file that will run automatically on double click

    all the jars I created run only from the command-line.
    how can I make it run by double-click on it?

    First you will need to associate .jar files with the javaw.exe program in order to just be able to double click on the jar and run it from within a windows explorer application. Next you will need to set the main class attribute of the manifest file. My understanding is that the value of this attribute is used by the launcher to know which class to load. In other words, which is your main application class. To specify this attribute open your manifest file in a text editor. You will find this file located within the jar at META-INF/MANIFEST.MF. Then, add the line,
    "Main-Class:<relative path to the main class>" However, remember not to add the .class extension to the end of the class name.
    In Windows 2000 you can associate jar files with javaw by finding a jar file in Windows Explorer and right clicking it. This will give you a context menu which should have an Open With... option (if you are not using Windows 2000 and don't see the 'open with' menu item, try holding down the shift button while right click on the file). Select the Open With... option, then, when the dialog appears highlight javaw and select the "Always use this program to open these files" checkbox. When you hit the OK button you should have all your jar files associated with the javaw process.
    Once you've done this, you should be able to double click on your jar file and run your application.
    Regards,
    Daniel Walsh

  • Dynamic jar file inclusion at run time

    Hello,
    I have a java application which should accept the three parameters.
    1) The jar file location
    2) Particular Class file insdie that jar(we specified the location in step number 1)
    3) And method name in that class.
    My question is how to include specified jar location with jar name to CLASSPATH at run time. So that i can execute a particular method name in step number (3).
    I would appreciate for the quick reponse or any input.
    Thanks,
    Raghu

    And if you want to change the system classpathduring
    runtime, don't forget that you can always use
    reflection to call the System classloader'sprotected
    addUrl method :)Really?
    Seems reasonable although this is the first time I
    have seen that referred to.you can indeed. I've done this, as a quick avoid-writing-a-classloader hack. wouldn't really recommend it, though. if you're using reflection to modify access, chances are you're doing a massive fudge
    and of course, since it's not part of a public API, there's absolutely no reason to the method won't simply disappear in a future release....

  • Jar file won't run

    Why is it that whenever i run my program using eclipse it works fine but whenever i export a jar file of it, it doesn't run at all?
    It does not even give an error message and this happens for only one specific class, all the others expoort perfectly

    Probably either 1) the jar file is not located where it should be, or 2) the jar file does not have (or it's incorrect) a manifest file.
    Since you don't give any useful diagnostic information, hard to tell more.

  • Jar file doesn't run properly, please help!

    Hi everyone, i'm a student and i'm programming a game for my homework of AI subject. When i compiled the code from Eclipse, the game run smoothly, but when I create the jar file of the project, it appear blank when i run it. Here is the image:
    [blank screen|http://c.upanh.com/upload/4/299/3L0.8429518_1_1.png]
    and run from Eclipse:
    [Run from Eclipse|http://c.upanh.com/upload/4/299/TL0.8429668_1_1.png]
    I have followed the instruction of creating jar file in Eclipse properly, and now the trouble come. If anyone can show me how to solve this problem?
    Thanks all.

    I have all of e.printStackTrack( ) in my try - catch block. But i also think the blank screen appears because the class can not find my resources. Maybe it's my fault, because i create by hand a folder name "res" in project folder, then put all my resource in this folder. And in Eclipse when i try to get these resource, i wrote something like this:
         Image robot1N, robot1E, robot1S, robot1W;
         private void initResources() {               
              try {               
                   String sb = "car1";
                   robot1N = ImageIO.read(new File("res\\img\\unit\\" + sb +"_N.png"));
                   robot1E = ImageIO.read(new File("res\\img\\unit\\" + sb +"_E.png"));
                   robot1S = ImageIO.read(new File("res\\img\\unit\\" + sb +"_S.png"));
                   robot1W = ImageIO.read(new File("res\\img\\unit\\" + sb +"_W.png"));
              catch(Exception e) {
                   e.printStackTrace();
         }Maybe the string of path to resource is right in Eclipse but wrong in Window?

  • Decompiling jar file and then run

    Dear Members,
    I have a jar file and I have decompiled that jar file and converted into class file,
    now I want to run/edit using source code ,I am unable to run source code with out put whatever coming in jar file running,
    I am trying with class in which
    public static void main(String[] args)
    function defined,
    I am using Jcreater1.5 and from command prompt also running but unable to run and edit the programm,
    how to run these class file in complete project that output will come as running jar file
    regards
    SACHIN

    It sounds like you have unpacked the jar.
    To edit the source you need to decompile the classes to .java files.
    [http://www.google.co.uk/search?q=java+decompiler]

  • JAR files don't run on Linux

    Hey All:
    I installed JDK1.3.1(win32) on Windows, double clicked my JAR file (proper manifest and classes within) and it started the swing program just fine.
    I installed JDK1.3.1(linux) on Red Hat 7, double clicked my JAR file, and it wants to know which Fk'n program to open it with! What happened here, I thought java/swing runs on linux?
    The JDK installed java in /usr/java/jdk1.3.1/bin/java, do I somehow need to point linux there for .jar files to execute automatically? What are the commands to do this?
    Thanks in advance,
    Stephan

    As far as I know, the double clicking on a jar file to execute it only works on windoze. On linux, you can can use:
    java -jar foo.jar&
    to execute the jar, assuming you have the main class included in the manifest. I don't know if there are any plans to change this. You should be able to write a script or somesuch which prepends 'java -jar' when you double-click.
    m

  • User Select File Path Before Running Rest of VI?

    I am designing a system where data is being acquired and written to 12 data files, and I would like to have the operator have the option of selecting the data path while keeping the filenames of the individual files constant. It is necessary for the data not to be acquired until the operator completes the prompt so the data acquisition and writing are synchronized.  How can design my VI to not start the data acquisition and writing the data until the operator has selected the file path?
    I've attached my program below. It has a producer/consumer design with two consumer loops. One consumer loop will process and write the data and the other controls a water bath based on the data that is acquired.
    Attachments:
    Composting System Program.vi ‏123 KB

    NT_Engineer,
    Hello! If I understand what you are asking correctly, you just want to have the user select a file path before you start your data acquisition, control, and file writing. Is this correct?
    There are multiple ways in which you could do this.
    As mentioned previously you could design your VI to operate like a State Machine.
    A flat sequence structure could be used to first execute a dialog portion of your code, and then the data acquisition portion.
    You could use an event structure to not start your program until a user clicked  "Done" button.
    Let me know if this is what you were asking.
    Ben Sisney
    FlexRIO V&V Engineer
    National Instruments

  • App runs in Eclipse environment but not from jar file with no error message

    When I upgraded my jre to 5.0 my app does not run. After fixing the properties problem I had a few days ago it is now at least compiling and running within Eclpse
    However, when I export to a jar file it runs to a certain point and then just goes away with no error message!!! I've narrowed it down to the exact point where it dies but don't understand why it dies and especially gives me no errors whatsoever. It just goes away.
    It is creating an instance of a new class when it dies.
    Can someone please help me?

    Ok, well it doesn't. Anyway, I'm still having the same problems. I can run my jar file to a certain point and then the application just stops. I know this because I've put come message boxes in the application to let me know where in the app the system is.
    It always dies when it is instantiating the new class called HeidiFrame; done by:
    HeidiFrame heidiFrame = null;
    if I put code in between the above line and before the below line, this code will work fine
    heidiFrame = new HeidiFrame();
    but if I put code after the above line, nothing happens
    As I said this all worked fine until I upgraded to Java 1.5
    If you look at http://java.sun.com/javase/technologies/compatibility.jsp there are 23 compatibility issues with the new release. We're using xml stuff so that was my first problem and the code wouldn't even compiile. Once I added in libraries, the code compiled and ran beautifully.
    However, when creating my jar file so I can deploy this application , I've discovered that the jar file will only run to a certain point, as I've stated previously. So, that's my problem. Not that I can't run it from the command prompt, which I can't, but it's a gui application. I've tried changing things in the classpath file and the manifest to no avail. Nothing changes. The application starts but when it goes to instantiate the HeidiFrame class, which is the class that actually builds the gui it dies and goes bye bye.

  • Help with a question about making/running .jar files.

    First i have a question, can i make a .jar file that can run on a computer without JRE installed. And if i can, how do i make it. I have tried to make it on my computer, that has JRE but i keep getting the error when i run it: Exception in thread "main" java.lang.NoClassDefFoundError: Sample\FileSearchAnd im using the command:
    jar cvfm jarname.jar directory\manifest.txt directory\FileSearch.class directory\FileNode.classIt says it creates the .jar but is unable to run it.

    dford425 wrote:
    First i have a question, can i make a .jar file that can run on a computer without JRE installed. No, not unless you package the JRE with your dist. Hence the name JRE (Java Runtime Environment).
    And if i can, how do i make it. I have tried to make it on my computer, that has JRE but i keep getting the error when i run it: Exception in thread "main" java.lang.NoClassDefFoundError: Sample\FileSearch
    That simply means your not pointing the runtime to the classes. Set your CLASSPATH environment variable correctly and it will run (given you have a JRE which it appears you do).
    And im using the command:
    jar cvfm jarname.jar directory\manifest.txt directory\FileSearch.class directory\FileNode.classIt says it creates the .jar but is unable to run it.

  • "no manifiest section for signature file entry" when run the Jar file

    I built an application by using JBuilder 8.0 and it works fine. But when I deploy it into a jar file, whenever I run it, the following exception appears:
    Exception in thread "main" java.lang.SecurityException: no manifiest section for signature file entry javax/security/cert/Certificate.class
    at sun.securtiy.util.SignatureFileVerifier.verifySection
    Because I didn't do anything about the security when build the application. I am really confused. Can somebody help?

    I had a similiar problem using NetBeans. There must be a way to view the properties of your jar from Jbuilder and set its manifest. I am very new to this myself, but all I did was edit another manifest and copied into mine. Here is my example manifest:
    Manifest-Version: 1.0
    Main-Class: J3Ed
    The first line is the default line for a manifest. It is very simple and there is much more that could be added, but is not always necessary. I recommend reading the documentation :
    http://developer.java.sun.com/developer/Books/javaprogramming/JAR/basics/manifest.html
    Also if you have an archiving utility such as powerarchiver or winzip, open your JAR and check to see that you have a MANIFEST.MF file. If you do then edit it where needed, if not create one and its relative location should be set to META-INF/MANIFEST.MF.
    Hope this helps.

  • Jar file runs on windows but fails to run on macbook

    hi, i developed this app using netbeans on windows and the .jar is runing fine, but when i transfered the jar file to a macbook and double clicked the jar file, it dint run, then i tried to run it from the terminal i got the following exception. please what could be the problem
    mustapha-mohammed-kutas-macbook:~ mustaphamohammedkuta$ cd desktop
    mustapha-mohammed-kutas-macbook:desktop mustaphamohammedkuta$ cd mustee
    mustapha-mohammed-kutas-macbook:mustee mustaphamohammedkuta$ java -jar PayrollProject.jar
    Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
         at java.lang.ClassLoader.defineClass2(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:774)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:160)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:254)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
         at payrollproject.Main.main(Main.java:34)
    mustapha-mohammed-kutas-macbook:mustee mustaphamohammedkuta$

    This means the version of Java you're using on the Mac is older than the one you made your jar file with. I believe the default Java on Mac is Java 5. Perhaps you built your classes and jar with Java 6?

  • Jar file runs from the command line, but not when I double click it

    Hello, I'm running windows xp. I've created an executable jar file and it runs fine from the command line when I type;
    java -jar wizard.jar
    but, when I double click it . . . nothing.
    Any ideas?

    nothing ? that's weird, windows XP should prompt you to select the program you want to use in order to open Jar files (and give you this silly piece of advice to search the web for the appropriate program)
    you might want to check what program (if any) got associated with .jar extensions :
    in Windows Explorer : Tools => Folder Options => File Types
    hth

  • [b]Simple Deploy problem- making an Executable JAR File ...PLEASE HELP [/b]

    Hi all,
    I Trying to deploy a simple J2SE app by making an Executable JAR File, however I don'r understand how to add a valid value to the Main Class field.
    I followed the following description within Jdev, after creating a Deployment Profile:
    Deploying an Executable JAR File
    You can make your simple archive or J2EE Client Module into an executable JAR file that you can launch with the java command.
    To deploy an executable JAR file:
    1) Select and right-click the simple archive or client icon in the Navigator to display the context menu.
    2) Choose Properties.
    3) Click JAR Options in the tree.
    4) Select Include Manifest File (META-INF/MANIFEST.MF).
    5) In the Main Class field, enter the fully qualified name of the application class that is to be invoked.
    7) Click OK.
    8) Launch the executable JAR file from the command line:
    java -jar myapp.jar
    where myapp represents your JAR file name.
    Like I said it's in 5) I'm doing something worng
    My deploy-file (PlotPrint.deploy) looks the following:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <client-deployment xmlns="http://xmlns.oracle.com/jdeveloper/903/deploy/j2ee-client-jar" nselem="client-deployment" class="oracle.jdeveloper.deploy.jar.ClientProfile">
    <archiveOptions>
    <additionalManifests/>
    <compressed>false</compressed>
    <hasManifest>true</hasManifest>
    <mainClass>PlotPrintClient</mainClass>
    </archiveOptions>
    <archiveTargetPlatform/>
    <cdaSettings>
    <additionalArchives/>
    <afterFilters/>
    <beforeFilters/>
    <duringFilters/>
    <selectedArchives>
    <archives>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/jdbc/lib/classes12.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/jdbc/lib/nls_charset12.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/jdev/lib/jdev-rt.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/soap/lib/soap.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/lib/xmlparserv2.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/jlib/javax-ssl-1_2.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/jlib/jssl-1_2.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/j2ee/home/lib/activation.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/j2ee/home/lib/mail.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/j2ee/home/lib/http_client.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/webservices/lib/wsdl.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/lib/xmlparserv2.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/lib/xmlcomp.jar!/"/>
    </archives>
    <selectionMode>0</selectionMode>
    </selectedArchives>
    </cdaSettings>
    <defaultConnection class="java.lang.String"/>
    <deployClientMaxHeapSize/>
    <earURL path="deploy/PlotPrint.ear"/>
    <enterpriseAppName/>
    <jarURL path="deploy/PlotPrint.jar"/>
    <profileDeps/>
    <properties/>
    <selectedProjectFiles>
    <autoInclude>true</autoInclude>
    <deploySourceAs>0</deploySourceAs>
    <files class="[Ljava.net.URL;"/>
    <selectionFilters/>
    </selectedProjectFiles>
    </client-deployment>
    I using Oracle9i Jdev, but have also tried it un the new Jdev 10g version, but the same problem everytime:
    Error message: Could not find the main class: program will exit.
    Please help I really need this to work
    Message was edited by:
    MHCI
    Message was edited by:
    MHCI

    Yes that was the problem so I have changed the element mainClass to
    <mainClass>xxPlotPrint.MHCI.PlotPrintClient</mainClass>
    But now another probem has occured, since I get the following error when run the jar-file (When I run the app from within Jdev there are no warnings or errors).
    ----Batch-file-----
    @echo off
    java -jar PlotPrint.jar
    echo Test Plot and Print Batch-file!
    pause
    ---- out to cmd ----
    Exception in thread "Thread-0" java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl
    at xxPlotPrint.MHCI.NNE35_worker.run(NNE35_worker.java:42)
    at java.lang.Thread.run(Unknown Source)
    Exception in thread "Thread-2" java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl
    at xxPlotPrint.MHCI.OCEJobDB_worker.run(OCEJobDB_worker.java:41)
    at java.lang.Thread.run(Unknown Source)
    Exception in thread "Thread-1" java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl
    at xxPlotPrint.MHCI.NNE27_worker.run(NNE27_worker.java:42)
    at java.lang.Thread.run(Unknown Source)
    It's the same problem in all three exceptions (the exactly the same code), however I was a bit to quick this is the line (the line before I process the xml doc :-)
    import org.w3c.dom.Element;
    responseData = new Vector();
    responseData = test_NNE35_SOAP.getXSDdoc();
    Element elements = ( (org.w3c.dom.Element)responseData.elementAt(0) ); (line 42)
    Please help I don't understad why I receive this exception, since I included the xmlparserv2.jar file, and don't even have a workaround :-(

  • How to execute jar file

    Dear all,
    1. I am trying to import a .jar file and execute (run) in eclipse. I know it can be done from command window by java -jar z.jar . But I am supposed to do it in eclipse . I would appreciate your help.
    2. jar files are supposed to be executable. But in my premium window vista as well as in XP it doesnot run by double click though I have given the class path. How can it be done?

    jar files are supposed to be executable.Only if you have a file association for the extension.
    Presumably when you double-click the .jar file, Windows pops up the "Open With" dialog. Select from the list or click Browse... and navigate to java.exe (javaw.exe if you are only going to run GUI applications) in the jre/bin folder. Select "Always use the selected program to open this kind of file" and optionally enter a description for the file type before clicking OK.
    Note that a console application opened in this way may flash the console window and terminate i.e. the console will NOT remain open after the application dies.
    I don't use Eclipse so I can't help on your other question.
    db

Maybe you are looking for

  • Camera roll frozen & low resolution photos on 'save image' since 4.1 update

    Have a couple of problems with my 3GS since I updated a few days ago to OS 4.1. The camera roll when accessed from the home screen freezes when I click on any images that I saved from a website using Safari, though any images that I took using the ca

  • Command lines in text module is not working in adobe forms

    Hi, I have a problem, I have a text module with variables and I placed it in Adobe form its working fine, my problem is I added a command line /: NEW PAGE in the text module, it couldn't trigger a new page at that place.Can anyone help me out in this

  • Libraries for SIM card toolkit

    Hi, If I want to write a Java applet for a smart card I need the Jar files from the Java Smart Card dev kit (like javacardframework.jar etc) since they implement the Java Card APIs. If I want to write a Toolkit applet where do I get the Jar files (li

  • Error with Eclipse - please help me

    Hi I know that maybe that's not the best place to ask about DisplayTag, but You are my last chance !!! So please help me! I am using DisplayTag in my web application. Could You tell me please why a got such error in my class? The type javax.servlet.j

  • No item exist in uwl after delpoying uwl custom connector

    Hi,gurus, I'm developing a uwl custom connector now ,but after successfully deploying par file into portal,there are no items in uwl.We have regeisted the connector,and the connector status in uwl is successful.Below is the code of getItems(..).We di