Load Part of the jar

Hi Team,
My Jar size is very huge.My applet is loading the entire jar at a time.I want to load part of the jar(That means only needed files at start) , later dynamically i will load the other files.
Is it possible?, if it is possible could you please explain clearly.
Thanks
T. Shankar Reddy

I Got the solution.
I did the Main.jar is into three Jar's.1) Main.jar 2) Child1.jar 3) Child2.jar
Now Main.jar size very less--> This jar contains classes needed for the startup application.
Child1.jar, Child2.jar will be loaded when ever it needed. But don't the put the child's jar in the classpath.
Thanks
T. Shankar reddy

Similar Messages

  • Loading Image outside the jar

    I have a .jar program that saves and loads imagens from a folder outside the jar. In my directory I have:
    myProg.jar
    images(folder)
    This is the way myProg.jar saves the images:
    BufferedImage myImage; //myImage is initialized somewhere else
    File file = new File("images/Pic"+temp+".jpg");
        try{
        ImageIO.write(myImage, "jpg", file);
           }catch(IOException io){}
    }catch(AWTException ea){}When I check the image is saved in my folder "images"
    Then, the prog tries to load the images this way:
    URL url = getClass().getResource("/images/"+name+".jpg");
    ImageIcon icon;
             if (url != null) {
                  icon = new ImageIcon(url);
                  picture.setIcon(icon);
             else {
                  url = getClass().getResource("/images/street.jpg");
                  icon = new ImageIcon(url);
                  picture.setIcon(icon);
             }Here I have an exception : Exception in thread "AWT-EventQueued-0" java.lang.NullPointerException
    I checked the url and it�s ok.
    Hope someone help.

    Well, I modified the getJarPath method to this:
    String getJarPath1(){
              String path=System.getProperty("java.class.path");
              for(int i=0;i<=path.length()-1;i++)
                   if(path.charAt(i)==';'){
                        return path.substring(0,i);
              return "";
         }Now I got the path I really need, for example:
    C:\Program Files\Eclipse\Workspace\myProject\images\pic.jpg
    Though, the picture is not loading. Here is what I am doing:
    String path=getJarPath1()+"\\images\\" + name + ".jpg";
    //path=C:\Program Files\Eclipse\Workspace\myProject\images\pic.jpg -> correct path
    URL u=null;
    try{
                 u = new URL(path);   //u is always null! why?
                }catch(MalformedURLException mf){}
    if(u!=null)
             try{
             icon = new ImageIcon(u);
             picture.setIcon(icon);
             }catch(Exception bla){}
             else {
             }What�s happening is that my "path" got the correct path, but when I put it in the URL it�s becoming null.
    The picture and the folder are in the correct place.
    I hope someone helps. Thx!

  • Updated my iphone and now my screen is stuck on the loading part with the apple logo! help

    it wont turn off or connect to itunes or anything!

    go into dfu mode and then restore with apple

  • Itunes only loads parts of songs.

    When i load cds onto itunes it only loads parts of the songs, and for some it says 'not available'.
    For example dani california, which is 4:42 long, only comes up as 1:19, and snow, the song after is 'not available'.
    The cd's work in my cd player 100% fine, and all the tracks are there, just not complete.....
    Any fixes?

    It seems that I have the same problem.
    While am working on the Mac, I often listen music on iTunes 8.0.2 (iMac G4 OS X 10.4.11) with Shuffle On, Repeat Off, I notice some pieces doesn't play completely and change before the end.
    Opening the music file with Sound Studio, I saw that a part is missing (Waveform is flat). Sometime only few second at the end, but sometime only few second left at the beginning !
    What could have gone wrong ? How to fix this ?
    Thanks for any help you can give,
    (I looked on my BackUp Disk to restore the full missing number. Unfortunately, it seems that SuperDuper "Sand Box" has already BackUp and replace the right full numbers with the defect one !)

  • Hi my iph4s wont turn on or off and seems to be zoomed into a particular part of the screen, loads normally when rebooted the phone. what is wrong with it? and how would i go abouts fixing it?thanks

    hi my
    iph4s wont turn on or off and seems to be zoomed into a particular part of the screen, loads normally when rebooted the phone. what is wrong with it? and how would i go abouts fixing it?
    also recovery mode shows up as a red icon instead of a blue one, not jail broken or had any third party alterations
    thanks

    Reset the PRAM
    Reinstall the operating system from the dvd (you will not loose your data)

  • Error while loading the jar file using loadjava

    Hi,
    I'm trying to load a jar file in to a database through the loadjava utility. First time when i loaded a jar file it created few public synonyms with /'s. like /5b3d7f97_BeanInfoIndexer.
    Now i want to drop these synonyms before i reload the jar file with loadjava.
    If i use DROP PUBLIC SYNONYM /5b3d7f97_BeanInfoIndexer; it gives the following error...
    ERROR at line 1:
    ORA-00933: SQL command not properly ended
    I wonder how to drop these synonyms. I have to drop all these synonyms to freshly load the jar file.
    Thanks
    Shiva

    You can include the synonym names in double quotes in the drop synonym command. But it is not a good idea to drop the synonyms(which have been created by loadjava) using drop synonym command. Instead, you can use dropjava command which will automatically drop all the synonyms created by the loadjava command.

  • What can I do about "LabVIEW load error code 38: Failed to uncompress part of the VI."

    While attempting to load an executable LabVIEW application for LabVIEW 2009 SP1 on a Windows-XP machine when the following pop-up message occurs. "LabVIEW: Memory or data structure corrupt. An error occurs in loading VI 'NI_Gmath.lblib: Backward Bracket Search.VI'. LabVIEW load error code 38: Failed to uncompress part of the VI. The VI is most likely corrupt." What seems odd is that the same LabVIEW application loads fine when logged on as a privileged user account, but fails to load on a private user account.
    Attachments:
    2012-07-18 LabVIEW Load error code 38.jpg ‏1314 KB

    Here's a thought:
    So when something is decompressed, a temp folder is often used. 
    I have no idea why LabVIEW would be decompressing anything, but I suspect it is trying to put the decompressed file into a temp folder where the user does not have write permissions.
    In the .ini file for your executable, you can add a line that specified the location of the temp folder to use:
    tmpdir=C:\Temp
    On my Win7 machine, the location is:
    C:\Users\MyUserName\AppData\Local\Temp
    On WinXP, it is probably:
    C:\Documents And Settings\YourUserName\local settings\temp
     Try changing the tmpdir key in your ini file to something to C:\Temp and see if that helps.
    - john

  • Problem With Loading the jars

    Hello Experts,
    I am facing a problem with loading classes.
    i have written one application which is running on server.in that application want to use certain jars(Classes)and those jars anmes and
    classes inside the jars are same.based on the condition i want to call
    corresponding class.
    can any one suggest the solution
    it's urgent
    any help will be appriciated
    thanks in advance
    With regds
    Bankuru

    Hi Yogee,
    Thanks for ur help.
    i have 4.o jars and 5.1 version jars.depending on the condingtion system must use the corrensponding jar.the problem here is that both jars has same clasees and code inside that one is differnet.
    when i run application with 4.o condition then 5.1 is not working and
    if i run tha application with 5.1 then 4.o is not working.
    can u please suggest the possible solution
    i have deployed these jars in application server
    With Regds
    Bankuru

  • How do I load property files and images stored in the jar file?

    Hi
    So, if I have a structure like this:
    /com.myfirm.myproject.SomeClass
    /images/
    /properties/
    And I pack this structure into a jar file, how do I then access the images under "/images/" and the property files under "/properties/"? A link to a good tutorial on this would be perfect, or a description/hint/howto :)

    Im having problems even loading direcly from the directory..? I have this structure:
    src (source dir)
    classes (classes dir)
    lang/textRb_en_US.properties (the file I want to load)
    Then I have this code:
    Locale currentLocale = new Locale("en", "US");
    ResourceBundle textRb = ResourceBundle.getBundle("/lang/textRb", currentLocale);But it gives me a "java.util.MissingResourceException: Can't find bundle for base name /lang/textRb, locale en_US". I start my application from within Eclipse, and I have tried to move "lang/textRb_en_US.properties" into the classes dir, but same error.
    Im confused as to there Java looks for ressources, and I need this to work no matter where I put my classes/jar. Could you help me out here?

  • Loading a DLL which is part of a JAR file

    I have a C++ DLL which I can successfully load from Java using JNI when the DLL is in the same directory as my JAR file. However, for packaging reasons, I would like to bundle the DLL inside the JAR file. When I do this, I can no longer load the DLL. I've tried modifying the java.library.path property using -D on the java invocation. I've tried setting java.library.path to the current directory, and also to the JAR file which contains the DLL, but neither works. I have a platform-independent JAR file which contains my base code. I also have a Windows JAR file in which I'd like to ship the DLL. It is within the Windows JAR file that I've placed the Windows DLL. I put both JAR files in my classpath, and they both load, but I'm stuck on the DLL. I've search the forums, and it looks like someone on the WebStart forum did something like this, but he was not specific about whether the DLL was contained within the JAR file.
    Here is the error:
    java.lang.UnsatisfiedLinkError: no WindowsAudio in java.library.path
    If all else fails, I will ship the DLL separately, but I was hoping there was a way to ship it within the JAR file.
    Thanks.

    >
    Let me know if you figure out how to delete the dll
    file from the applet once it is loaded.It is possible. I have done it but it is a bit convoluted.
    The key is in having the dll loaded by a ClassLoader that can be GCed when you no longer need the dll. When the ClassLoader is GCed, the dll is unloaded from memory and then you can delete it. You can only create new ClassLoaders from signed code, but that should not be a problem because it has to be signed to load native libraries.
    It basically goes something like this:
    In the base ClassLoader define an interface to all the methods you need in the native code.
    In create a ClassLoader that will define a class that implements the interface, and get a reference to an instance of it via Class.forName(String, boolean ClassLoader); Now you can access all the needed methods through the interface.
    Load the native code via the new ClassLoader.
    When you are done set all references to things loaded by the new ClassLoader to null, call System.gc() and System.runFinalization() several times to make sure it is cleaned up.
    Then you can delete the native library.
    As an alternative use a PhantomReference to the ClassLoader and then do the delete when the PhantomReference is enqueued. That way you don't have to call System.gc().

  • How to list the JAR files loaded into the Oracle Database ?

    How to list the JAR files loaded into the Oracle Database ?

    From 11.1 onwards, the below two views are available to identify the jar files loaded into the Database.
    JAVAJAR$
    JAVAJAROBJECTS$
    By querying the JAVAJAR$ view you can know information about the JAR files loaded into the Database and using JAVAJAROBJECTS$ view you can find all the java objects associated with the given JAR file.
    These views are populated everytime you use LOADJAVA with "-jarsasdbobjects" option to load your custom java classes.
    But unfortunately this feature is available only from 11.1 onwards and there is no clear workaround for above in 10.2 or earlier.

  • Why can't I load the image files in the Jar file?

    I make an application in a structure bellowing:
    A.class
    images\a.gif
    images\b.gif
    and I packed all of them(include the images directory) into a A.jar file.
    when I run the A.jar file,the application can't load the images in the Jar file.
    How can I do to solve this problem?

    It isn't working. The URL that is returned is blank. I tried rearanginf my stuff a little. Now it is set up like the other guys. So all the classes aren't in a package. so its:
    MyClass.class
    Sounds/mysound.wav
    all of this is in a .jar file. If it isnt in a .jar file it works. Bit I have mor than one class so I would really like it in a .jar file. But when it is MyClass.class.getResource("sounds/mysound.wav") returns nothing. Not null. Just blank.

  • .jar applet doesn't load deppending on the webserver...

    Hi all,
    I've got a little problem with an applet I'm trying to deploy... it's a signed applet I call from a HTML like this:
    <applet code="pack1.pack2.TheMain" width="975" height="575" archive="pack.jar" MAYSCRIPT>
              El navegador no deja cargar applets
    </applet>- pack1.pack2.TheMain is the main class name.
    - pack.jar is the jar containing all the classes with the correct packages definitons.
    If I put the index.html and the pack.jar files in an Apache webserver it loads correctly. (I understand that I ask for the html page, the browser sees that it needs a .jar file, it donwloads it, and tries to begin with TheMain.class).
    But I've tried to deploy with a very basic webserver, the implementation from http://www.opentcp.org/ . The html loads, it starts downloading the .jar, but when it has finished, the browser asks to the server for the TheMain.class file. Why??? it gives an error, because it's not in the server (there is only the .jar file with all files packed). The class should had been downloaded with .jar file, why does the browser ask it to the server?
    Perhaps some problem with headers.. mime types? I'm don't know much about this... do you now any reference?
    thanks a lot!

    thank you for your interest Peter... I'm a little confused, still working on it. I'll ask again later!

  • Loading my game files from the jar

    Hi again...
    I obviously have textures, maps, sounds, etc. for the FPS game to work. I want it to be in the jar file, but I'm having trouble loading the files directly from the jar, rather than from the files on my hard drive.
    Since I'm using, among other, JOGL, I require certaiin dll's for the game to work. How can I import the dynamic libraries in such a fashion that it can be somewhere in my jar file and still be loaded?
    Thanx!

    There is no button you can push in Premiere that will erase all your projects. Where were the .prproj files stored?
    Thanks
    Jeff

  • Clip for trailer won't load, regardless of the size the error message keeps popping up, "That clip is not long enough. Choose a longer clip for this part of the trailer."

    Clip for trailer won't load, regardless of the size the error message keeps popping up, "That clip is not long enough. Choose a longer clip for this part of the trailer."

    I got it out!
    Here is how.
    None of the Apple-suggested ways worked. However, before totally giving up I started Roxio Popcorn and pressed the big eject button on it. It came out effortlessly!
    So, I thought "Weird..."
    I put the CD back in and reproduced my original problem. I got it out just as easily using Roxio Popcorn Eject feature.
    So, I then thought "Maybe it is the disk?" There is nothing wrong with the disk as far as I can tell. It is perfectly round, has a smooth label-side surface. It is not even a label, it is a standard software install disk you buy in stores.
    I inserted a different disk. The mini mounted it, I browsed it, and then ejected it by dragging it to trash. Worked fine.
    I tried a few other disks.
    The drive seems to work fine.
    Maybe that CD is cursed, I dunno. I tried that disk in my PowerBook and it works fine there.
    Who knows ?
    I am still backing up my hard drive as I type this message in case I need to take it to the store.

Maybe you are looking for

  • I just updated my iphone 4s with iOS 6 and now it won't connect to wifi!

    I did the update and now it will not connect to wifi.  I have tried reseting, forgetting the network then reconnecting etc...almost everything and it still will not work!!!

  • Agent Inbox Refresh

    Hello experts, I have a requeriment for an agent inbox in CRM 7.0, i need to refresh automatically the inbox. I reviewed the BAdI: Agent Inbox, but i don´t find a method to do this. How i can do this? Any help will be highly appreciated. Thanks, Migu

  • Error: Enter a valid Production Version

    Dear Gurus                    I have a problem while production booking of a vehicle. It says Enter a valid production version. I have checked the version in Material master-->MRP4 view. The version is maintained there. What else whould i check ? Pls

  • Metadata filtering panel options not present in a library

    How do I get a metadata filtering panel in a document library? I have activated feature "Metadata navigation and filtering". But in the library there doesn't appear any related links in Library Settings. 

  • My adobe flashplayer 11 isnt working?

    I have tried uninstalling it and re-installing it, restarting my computer each time, it was working fine until a few days ago when it just stopped working, I have Windows Vista and I use Internet Explorer. Any ideas on how I can fix it?