Reading nested jar files

How to read and display contents of nested jar files
Let the jar format is something like this.
Parent.jar
            child11.png
            child12.xml
            child13.jar
                        child21.png
                        child22.xml
                        child23.jar
             -

You need to play around with classloaders to do it, and unless you know how to do this, there's little point someone giving you the code to, since you won't be able to debug it

Similar Messages

  • Nested jar files

    two questions:
    1) How can I get access to a nested jar file? That is lets say i have a jar file names "Outer.jar", which includes two jar files. These two inner jar files each have a main method. Example: "Inner1.jar" and "Inner2.jar". How can I run each inner jar file? Is this possible?
    That is: "Inner1.jar" works perfectly fine by itself, if it was the only jar file, and it has it's own main method. The same goes for "Inner2.jar". But, How can I put these two into a main jar file, "Outer.jar", and then run each of the two inner jar files?
    2) Is it possible to make a jar file that contains two jar files both of which have separate main methods?

    It makes a great deal of sense to nest jar files. For example, I'm trying to put together a standalone JavaHelp "document". Wouldn't it be great if my customer could double click on a jar file and have a JavaHelp view open up with the documents inside? This requires bundling a JavaHelp jar, a viewer jar, and the document jar containing the docs and helpset. The only thing the customer needs in a JRE. No fuss, no muss, no messy installation.
    Another situation is where I want to bundle up multiple jar files as one to simplify distribution and deployment.
    --jon
    I've never heard of anyone wanting to do this before
    but:
    1. I think the only way to do this will be to use a
    custom classloader. You could have a runnable class in
    your Outer.jar that launches a custom classloader.
    This custom classloader will load your classes and you
    can call your runnable classes in Inner1.jar and
    Inner2.jar using seperate threads. You need a custom
    classloader because if you launch you .jar from (for
    example) "D:\myJar\Outer.jar" and specify the
    classpath (in the JAR manifest file) to (for example)
    "lib/Inner1.jar" it won't look at the JAR file entry
    "lib/Inner1.jar" it will look in
    "D:\myJar\lib\Inner1.jar". You're going to have
    problems though because you're basically running 3
    programs in 1 JVM. Things like static variables and
    security are going to be an issue. Basically unless
    there is a very good reason to do this, it sounds like
    a bad idea.
    2. Yes.

  • Extract nested Jar File

    Okay, I've been looking all day for solutions to this problem and nothing I've found pinpointed the solution, so if anyone would rather point me to another site, that's great.
    I have a .jar installer ( installer.jar ) that contains the installer code and a nested jar file ( program.jar ).
    In my experience, plain text files work great in the "getInputStream() -> FileWriter.write()" method, but my way of handling images requires javax.imageio.ImageIO, and i'm hoping something similar exists for jars.
    ALL+* i want to do is extract that jar file into the current directory, but the ZipEntry.getInputStream() method didn't work, and JarInputStream just confuses me.
    If anyone has links to other topics or source code to point to how a jarfile can be extracted.

    Thanks for the help.
    After looking around and finally noticing the Pack200 package, I have the answer!
    JarFile jf = new JarFile( "outside.jar" );
    JarOutputStream jos = new JarOutputStream( new FileOutputStream( new File( "inside.jar" ) ) );
    Pack200.newUnpacker().unpack( jar.getInputStream( jar.getEntry( "inside.jar" ) ), jos );
    jos.close();This creates a JarOutputStream that will write to the FileOutputStream forever until closed.
    The Pack200 Unpacker takes the inputstream and outputs it to the JarOutputStream.
    When the unpack method returns, the jar file is ready. Close the jar output stream and you have a workable jar!

  • Read/Write Jar files?

    This is really a newbie question, but since there's a forum specifically for jar questions I figured it was better to start here and move it to the newbie section if y'all deem it appropriate.
    I have written a desktop application using Java 1.4.1 class libraries and intend the application to run on multiple platforms including Mac OS X, Windows XP and Linux. The application works standalone (not yet jarred) on the machine it was developed on, but now it's time to begin figuring out the distribution method.
    Right now, the application reads several files from a flat text-file database, allows the user to peruse and display the information in a variety of ways, and gives the user a method to add to the flat-file database as needed. The file is about a megabyte and is excerpted into memory at initialization, then not referred to again unless the user writes additional data. When the user generates new data, write traffic to the file is fairly light, maybe 2-3kbytes per session.
    I searched the forums for the best way to handle read/write data files for distribution and so far I haven't found anything that seems relevant, but surely the question must have been asked and answered before - maybe I'm using the wrong keywords?
    Anyway, I have three basic questions:
    1) Can I both read and write a file that's enclosed in a jar file? Or are files read-only once "jarred"?
    2) Assuming I can both read and write a file within my jar file, is reading and rewriting within the jar so inefficient as to make that a non-preferred approach?
    3) How do other folks who have a local read/write datafile in a desktop application deal with distribution? Keep the read/write datafile within the jar? Make a copy of it outside the first time the application is run and always read/write the copy outside the jar? Or some other strategy?
    Thanks for any suggestions you can give a newbie at the Java game.
    Jon

    Thanks, that was pretty much what I suspected.
    I have several data files and configuration files for this project, so I was trying to make the distribution as clean as possible. At least some of the config information can be hidden in Preferences, but I was struggling with the data files. I'll include the data files in my jar, then unpack them to the user's directory when launched the first time and work with them thereafter in the user's directory.
    Enjoy the Dukes!
    Jon

  • Problem reading a jar file ?!

    Hello,
    I am having a problem finding a class file which is inside a jar(xercesImpl.jar) which is in the classpath. I cant figure out what the problem.
    I suspect it could be because my JVM is not reading the jar correctly.
    When i click on a jar, a dialog box titled "java virtual machine launcher" saying "failed to load main-class manifest attribute .." is displayed.
    Is it that there are executable and non-executable jars, and JVM will execute only the former ones ?
    Or Does this mean somethign is wrong with my JRE/JVM??
    i also tried typing "jar t xercesImpl.jar" (to see if it can print the table of files) and it doesnt do anything, doesnt even return to the prompt.
    I am on win xp and few days back downloaded jdk1.5.0 and uninstalled previous jdk.
    it seems windows has its own jre. i am bit confused which is being used.
    i m a Java newbie, so please forgive my ignorance. Any help appreciated.
    Thank you.

    Hello,
    Well seems you are going through the horror of creating application jar file from command prompt. I went through the same and finally decided to make it through jBuilder. But the trouble persisted and I was getting same error as you were getting till I explicitly specified all the third party jar files I was using in the classpath and the problem was solved.
    I recommend you to explicitly set all the jars in classpath that are being used by your application. Also set the path of any resources if you have any.
    All the best.
    Hemanshu

  • Nested JAR file

    Hi,
    I have two JAR files - db.jar & dbserver.jar. This db.jar is nested inside dbserver.jar. And, I place db.jar file in the Manifest file's Class-Path Attribute as this.
    Manifest-Version: 1.0
    Class-Path: db.jar;
    Main-Class: suncertify.db.server.DataServerService
    When, I run this executable JAR as
    java -jar dbserver.jar
    I get this message, "Failed to load Main-Class manifest attribute from dbserver.jar"
    It not possible for me to have both "Class-Path" & "Main-Class" in my menifest file.
    How to solve this problem, am i making any mistakes?
    Thanx. in Advance,
    Shankar S

    You cannot put a jar inside a jar and expect it to run w/o a custom classloader. Sorry. Besides, your Main-Class attribute is set incorrectly anyway, it needs to be a path like you have but change the dots into forward slashes. This is what the error was trying to tell you.
    -Ron

  • Reading a jar file into a string

    I have a jar file that I want to open and read the contents into a string object. How do I do this ? Can someone post a sample code.
    Thanks you so much
    bala

    I hope you mean you want to get the contents of a file in a jar file and put in a string?
    You would create a URLClassLoader for that jar file, and call
    getResourceAsStream, and then treat it like anyother file to load into a string.

  • Nested Jars

    I am currently attempting to access a jar file (child.jar) embedded within another jar file (parent.jar). Any jar files being used are all signed with the same signature. When I try execute I get a "ClassNotFoundException". All classes are archived in child.jar. The file child.jar is embedded within parent.jar and parent.jar is signed which creates sParent.jar. I do not know the correct syntax to use two archives in the html file. I am looking into nested jars to avoid multiple security warnings when signing multiple jars (multiple warnings occur even when all jars are signed with the same signature). But signing the parent.jar file, there will only be one security warning. Is accessing nested jar files possible? If not, is there an effective alternative?
    Thanks,
    rjtrues

    No, accessing jars inside jars is not possible. So any alternative would be "effective". Your comment about "the html file" implies that you might be asking about an applet, and I don't know the syntax for that either. But I'm sure documentation for that exists.

  • How to retrieve constants value from compiled code in jar file?

    Hi everyone,
    I've been looking for a way to solve this for a week now, without any much success... and I've finally decided to ask the Java gurus for a solution! :-)
    Here's what I am basically trying to do:
    I have several jar files in which there are only compiled code (.class).
    In every class, there are 2 constants (declared as static final String) that I would like to retrieve (one is the version and the other the date of the last modification).
    My goal is to print a list of all the classes in the jar files with the values of these 2 constants for each class.
    The solution that I have right now to do this does not work properly: for now, I read all the elements of the classpath, check if these are jar files, and if so, I look into each one and load all the classes one by one and print the results.
    The problem with this is that it uses the method Class.forName(className) and as some classes are unfortunately present in many jar files (2 or 3 copies), once the classes have been loaded, then it won't be "reloaded".
    Without the possibility to "reload" these classes, I cannot see inconsistencies in the versions of the classes present in the jar files.
    I have read many articles, and I thought that I could then use a custom classloader and create a new instance of this classloader for each jar file.
    2 problems with this:
    - according to many posts in the different forums I have read, the jar files should not appear in the CLASSPATH (but this would be easier for me if I could use it...)
    - some classes will not be loaded if some classes (present in other jar files) are not loaded... and this makes things really really complicated to implement...
    So, I thought that I was maybe doing this the wrong way, and that there might be an easy way out of this...
    In fact, I do not need to load the classes... all I need to do, is take a sneak peek at the constants and print their values... and that's it!
    Somehow, I think that this is possible to retrieve the values of compile time constants (declared as static final String) as I can see that with Eclipse (when opening a jar file).
    So, my question is: how can I do that within my java application?
    Or maybe there is another easier solution to do what I need?
    Thanks in advance for your help!

    Hi everyone,
    I've been looking for a way to solve this for a week now, without any much success... and I've finally decided to ask the Java gurus for a solution! :-)
    Here's what I am basically trying to do:
    I have several jar files in which there are only compiled code (.class).
    In every class, there are 2 constants (declared as static final String) that I would like to retrieve (one is the version and the other the date of the last modification).
    My goal is to print a list of all the classes in the jar files with the values of these 2 constants for each class.
    The solution that I have right now to do this does not work properly: for now, I read all the elements of the classpath, check if these are jar files, and if so, I look into each one and load all the classes one by one and print the results.
    The problem with this is that it uses the method Class.forName(className) and as some classes are unfortunately present in many jar files (2 or 3 copies), once the classes have been loaded, then it won't be "reloaded".
    Without the possibility to "reload" these classes, I cannot see inconsistencies in the versions of the classes present in the jar files.
    I have read many articles, and I thought that I could then use a custom classloader and create a new instance of this classloader for each jar file.
    2 problems with this:
    - according to many posts in the different forums I have read, the jar files should not appear in the CLASSPATH (but this would be easier for me if I could use it...)
    - some classes will not be loaded if some classes (present in other jar files) are not loaded... and this makes things really really complicated to implement...
    So, I thought that I was maybe doing this the wrong way, and that there might be an easy way out of this...
    In fact, I do not need to load the classes... all I need to do, is take a sneak peek at the constants and print their values... and that's it!
    Somehow, I think that this is possible to retrieve the values of compile time constants (declared as static final String) as I can see that with Eclipse (when opening a jar file).
    So, my question is: how can I do that within my java application?
    Or maybe there is another easier solution to do what I need?
    Thanks in advance for your help!

  • Get list of classes present in an applet's Jar file?

    I have an applet for drawing diagrams, which is bundled in a jarfile together with classes for each type of element in the drawing (e.g. a class for drawing 2-input NAND gates, a class for J-K flip-flops, and so on). When I add a new type of drawing element I have to modify the applet to add the new class to the applet's "Insert" menu to allow the element to be inserted. What I want to do is to search the jarfile containing the applet for any classes derived from DrawingElement and add them automatically to the Insert menu when the applet is inited. I presume this would require using getClass().getClassLoader() to get the class loader that read the JAR file, but from there it would seem I need to know the name of the resource to load. Is there a way of browsing the list of resources in the JAR file?

    AndrewThompson64 wrote:
    That 'modify the applet' is not strictly necessary. The list of menu items and classes might be passed to the applet as applet parameters, or as a property file or XML (or whatever) that defines the available elements.I could do this -- I'm just trying to avoid getting the list out of step with the contents (or if you prefer, I'm just being lazy!).
    Is there a way of browsing the list of resources in the JAR file?Yes and no. You might try this general strategy (untested).
    1) Gain an URL to a resource in the Jar in which the plug-ins exist.
    2) Parse that URL for everything before the '!' symbol to get an URL for the Jar itself.
    3) Get an InputStream from the Jar via URL.openStream().
    4) Get a ZipInputStream by wrapping the InputStream.
    5) Iterate the ZipEntry(s) to identify classes in the correct package, and store them in a collection of some type.
    6) Iterate the collection and check each one for extending DrawingElement, using reflection.
    I am guessing step 6 will require the applet to be trusted.Sounds plausible, and I'll give it a whirl. However, I hadn't thought about the "trusted" bit of this; maybe I can just create new instances and cast to DrawingElement, ignoring any that throw exceptions. I'll have to give it a go and see what happens.
    BTW - once you have the right classes, how do you get the screen name of them? Is the name defined in one of the attributes of a DrawingElement? What prevents name clashes?Plan A: I have a getIdentification() method that returns a string identifying the element, but I have to keep this unique the hard way (by hand).
    Plan B: use the class name with some prettification (e.g. have a class _2_input_NAND_gate which gets displayed as "2 input NAND gate") so that the compiler does the work of keeping it unique. Not sure I like this, though.
    Many thanks for your help.

  • Error opening jar file

    I'm using WLS 5.1 SP8 on NT 4.0 and trying to setup a cluster. The cluster
              starts fine except when I try to deploy a session bean that is marked as
              clustered. I get an error about reading a jar file
              (D:/weblogic/mycluster/server196/tmp_deployments/ejbjar1559.jar) that WLS
              created when the server started. Every server is getting this error and I
              tried setting up the same paths (D:\weblogic) but it doesn't matter. Any
              ideas?
              Wed Jan 24 15:04:10 EST 2001:<I> <WebLogicServer> WebLogic Server started
              java.util.zip.ZipException: error in opening zip file
              at java.util.zip.ZipFile.open(Native Method)
              at java.util.zip.ZipFile.<init>(ZipFile.java:69)
              at java.util.zip.ZipFile.<init>(ZipFile.java:84)
              at
              weblogic.boot.ServerClassLoader.deploy(ServerClassLoader.java:141)
              at
              weblogic.cluster.AnnotatedServiceOffer.expandClassPath(AnnotatedServiceOffer
              .java:74)
              at
              weblogic.cluster.AnnotatedServiceOffer.readObject(AnnotatedServiceOffer.java
              , Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
              jectInputStreamBase.java, Compiled
              Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
              treamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
              tStreamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
              eamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
              treamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readArrayList(WLObjectInput
              StreamBase.java, Compiled Code)
              at weblogic.cluster.StateDump.readObject(StateDump.java:59)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
              jectInputStreamBase.java, Compiled
              Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
              treamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
              tStreamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
              eamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
              treamBase.java, Compiled Code)
              at weblogic.cluster.TMSocket.execute(TMSocket.java, Compiled Code)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
              Code)
              Wed Jan 24 15:04:19 EST 2001:<E> <MulticastSocket> Multicast socket receive
              error: java.lang.RuntimeException: I/O error
              opening JAR file from
              file:/D:/weblogic/mycluster/server196/tmp_deployments/ejbjar1559.jar
              

    From previous posts I see this is a known bug. Is there a fix yet? btw, how
              did a bug of this magnitude
              get past QA. :(
              Elan Halfin <[email protected]> wrote in message
              news:[email protected]...
              > I'm using WLS 5.1 SP8 on NT 4.0 and trying to setup a cluster. The cluster
              > starts fine except when I try to deploy a session bean that is marked as
              > clustered. I get an error about reading a jar file
              > (D:/weblogic/mycluster/server196/tmp_deployments/ejbjar1559.jar) that WLS
              > created when the server started. Every server is getting this error and I
              > tried setting up the same paths (D:\weblogic) but it doesn't matter. Any
              > ideas?
              >
              > Wed Jan 24 15:04:10 EST 2001:<I> <WebLogicServer> WebLogic Server started
              > java.util.zip.ZipException: error in opening zip file
              > at java.util.zip.ZipFile.open(Native Method)
              > at java.util.zip.ZipFile.<init>(ZipFile.java:69)
              > at java.util.zip.ZipFile.<init>(ZipFile.java:84)
              > at
              > weblogic.boot.ServerClassLoader.deploy(ServerClassLoader.java:141)
              > at
              >
              weblogic.cluster.AnnotatedServiceOffer.expandClassPath(AnnotatedServiceOffer
              > .java:74)
              > at
              >
              weblogic.cluster.AnnotatedServiceOffer.readObject(AnnotatedServiceOffer.java
              > , Compiled Code)
              > at
              >
              weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
              > jectInputStreamBase.java, Compiled
              >
              > Code)
              > at
              >
              weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
              > treamBase.java, Compiled Code)
              > at
              >
              weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
              > tStreamBase.java, Compiled Code)
              > at
              >
              weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
              > eamBase.java, Compiled Code)
              > at
              >
              weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
              > treamBase.java, Compiled Code)
              > at
              >
              weblogic.common.internal.WLObjectInputStreamBase.readArrayList(WLObjectInput
              > StreamBase.java, Compiled Code)
              > at weblogic.cluster.StateDump.readObject(StateDump.java:59)
              > at
              >
              weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
              > jectInputStreamBase.java, Compiled
              >
              > Code)
              > at
              >
              weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
              > treamBase.java, Compiled Code)
              > at
              >
              weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
              > tStreamBase.java, Compiled Code)
              > at
              >
              weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
              > eamBase.java, Compiled Code)
              > at
              >
              weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
              > treamBase.java, Compiled Code)
              > at weblogic.cluster.TMSocket.execute(TMSocket.java, Compiled Code)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
              > Code)
              > Wed Jan 24 15:04:19 EST 2001:<E> <MulticastSocket> Multicast socket
              receive
              > error: java.lang.RuntimeException: I/O error
              >
              > opening JAR file from
              > file:/D:/weblogic/mycluster/server196/tmp_deployments/ejbjar1559.jar
              >
              >
              

  • Where are jar files downloaded to with Applet?

    I have an Applet and am using archive attribute in my applet tag to specify jar files needed by the applet. eg: "archive=myclassfiles.jar, foo.jar". Assume that myclassesfiles.jar has classes needed by the Applet and Foo.jar has some text files or xml files. Assume that Applet is signed.
    My question: I am assuming that all jar files are downloaded to the client when the Applet is started. Is this correct? If so, how can I open and read Foo.jar file within the Applet? I dont know the path to that file, that is, I dont know where on the client that Jar file has been downloaded to. Would the following work:
    URL aUrl = (new File("Foo.jar")).toURL();
    String path = aUrl.toString();
    would path point to the correct location of Foo.jar?

    They are downloaded to the client, and stored in a cache. I'm not sure they are readable from within the applet, however. But there are 2 solutions, depending on what you are doing.
    1) You want to get some images or other resources from the Jar file. Then do this:
    URL url = appletClass.getClass().getResource("myimage.jpg");
    ImageIcon icon = new ImageIcon(url);
    where appletClass is the applet object, and the resource ("myimage.jpg" is the relative path to the image in the Jar file.
    2) You want to muck around with the Jar (read it). Well you can't write to it that easily in an applet, as you can't access the file system without a signed applet, or you would have to POST it back to the web server via HTTP file upload. But if you want to just read it and get stuff out of it, you can always just do this:
    URL url = new URL(getDocumentBase(), "foo.jar");
    and then open the URLConnection for that URL and read the Jar in.

  • Can we make jar file for simple j2se application

    Hi..Can we make a jar file for simple j2se application so that it can be executed on any system like .exe file...

    Read the JAR files section in Sun's Java tutorial.

  • Problem loading image from jar file referenced by jar file

    First, I searched this one and no, I didn't find an answer. Loading images from jar files has been pretty much done to death but my problem is different. Please read on.
    I have my application, a straight up executable running from Eclipse. It uses a jar file, call it JarA. JarA launches a GUI that is located in another jar file. Call it JarB. To recap:
    My application calls JarA -> JarA loads classes from JarB -> JarB looks for images to place in a GUI it wants to show on the screen
    When JarB goes to load an image the following happens:
    java.lang.NullPointerException
         at sun.misc.URLClassPath$3.run(URLClassPath.java:316)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.misc.URLClassPath.getLoader(URLClassPath.java:313)
         at sun.misc.URLClassPath.getLoader(URLClassPath.java:290)
         at sun.misc.URLClassPath.findResource(URLClassPath.java:141)
         at java.net.URLClassLoader$2.run(URLClassLoader.java:362)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findResource(URLClassLoader.java:359)
         at java.lang.ClassLoader.getResource(ClassLoader.java:977)
         at org.cubrc.gmshell.gui.MainWin.preInit(MainWin.java:152)
         at org.cubrc.gmshell.gui.MainWin.<init>(MainWin.java:135)
    The code from JarB that loads the image looks like this:
              URL[] oSearch = {Main.class.getResource("images/")};
              URLClassLoader oLoader = new URLClassLoader(oSearch);
              imgIcon = new ImageIcon(oLoader.getResource("icon.gif"));
              imgMatchRunning = new ImageIcon(oLoader.getResource("gears.gif"));
              imgMatchStill = new ImageIcon(oLoader.getResource("gears-still.gif"));
              imgMagnify = new ImageIcon(oLoader.getResource("magnify.gif"));This looks right to me and JarB certainly has an images directory with those files. But I'm in hell right now because I don't know where to place the images to make this work or if you can even attempt to load images with a dependency chain like this.
    Any help very appreciated!

    Have you tried to move your image-files out of the jar file and place them in the sam folder as the jar-file? I think that would help.
    When you try to load the image-file you get the NullPointerException because the program tries to read a file it can't find. Remember that a jar file IS a file and not a directory.
    If you want to read somthing inside the jar-file you need to encode it first.
    Have you tried to read the jar-file with winRar. It makes it easy to add and remove files in your jar-file.

  • Why i can't execute jar files

    Greetings
    I read that jar files are executable unpon clicking them, but with me it do nothing.
    right now i'm using the command prompt to decompress jar files
    jar -xf jarfile.jar
    i have windows xp professional with j2sdk1.4.1

    You can execute JAR files by double-clicking them if the JAR files have an appropriate manifest and your file associations are set correctly (i.e. make sure you open JAR files with JAVAW.EXE). You can learn more about the manifest here:
    http://java.sun.com/docs/books/tutorial/jar/basics/manifest.html

Maybe you are looking for

  • PSE 7 Sort order in file folder view

    In Thumbnail view I can order the photos by oldest first or newest first. When I change my display option to folder view the photos do not display in any order. Not the order taken (oldest to newest) or (newest to oldest) or by filename. I am unable

  • Saved "Your Music" music has disappeared in Windows client

    HI All the saved albums i have in my "Your Music" collection have disappeared from the Windows (7)  client (1.0.8.59.gee82e7e6).  They still appear in the Android client. What happened ? ThanksJon

  • Fonts don't display correctly

    I opened a site to make some updates, and several of my fonts are not displaying correctly in the Design window.  When I click on Preview the fonts are correctly displayed, but some graphics and text move position. Is anyone else having these problem

  • Marketing Attributes alignment from Parent BP to Child BPs

    Hi, We have a requirement of updating marketing attributes on child BPs if they are getting changed at the Parent BP. For eg If attribute A is getting changed at Parent using transaction BP, system shoudl fetch all its child BPs from BP hierarchy in

  • Pavilion 23xi left half of the screen seems stripy and darker

    when using the computer left half of the screen suddenly flashed green and got darker, seems like it's stripy, like covered with a thin black net. i tried updating graphics drivers, restarting computer, changing monitors settings like refresh rate an