Using resources from an external JAR inside a JAR

Hi,
I'm trying to package all parts of my application into a JAR file so I can deploy my application using Java Web Start. However, I have an issue.
I need to use the files from an external JAR, Ice.jar, with my application. Therefore, I included Ice.jar in my build, specifically in the lib/Ice.jar directory.
This does not seem to be working; my application cannot read the information from the Ice.jar file when I launch my JAR file. It does work in one instance, however:
I have a directory included in the same directory where my JAR file is. This directory is named lib, and contains Ice.jar. My directory structure is as follows:
dist
dist/NVAC.jar //my JAR
dist/lib/Ice.jar //the external JARMy JAR file, NVAC.jar, will ONLY work if that lib directory is included in its directory. This is NOT what I want to do; I want to include the external JAR inside my JAR file, so a user will only have to download the JAR file. I have included the external JAR inside my JAR as I mentioned previously; at the path myJAR/lib/Ice.jar.
Therefore, how do I use a resource from an external JAR inside my JAR? Do I have to use ClassLoader? ClassLoader.loadClass() perhaps?
If I can provide any more information, please let me know.
Thanks

Seems to me it isn't practical to want to do things
that don't work. Especially since you're using
WebStart and it takes care of dependent jars
automatically for you if you configure things
correctly, so this absurd idea of jars inside jars
isn't even helpful.Dang DrClap, you seem to be the go-to guy for destroying all my ridiculous ideas (no offense; I mean that in a good way).
Seems I did not understand JWS fully when I thought of that idea. I researched it more after reading the replies here, and I see that I was indeed thinking absurdly.
Thank you for the help,
Dan

Similar Messages

  • Can i use applications from an external hard drive?

    Can i use applications from an external hard drive?

    Photoshop itself needs to reside inside of it's Applications folder so that it has access to it's Libraries and plugins. So if you are going to attempt to store and run it from an external drive you need to copy the whole Application folder or install it directly to the external drive. Even still I am not 100% positive it will work as I know it still needs to access your Library/Application Support for additional files and licensing.
    Why do you want to run Photoshop from an external drive?
    George

  • Using iTunes from an external harddrive?

    I would like to know if it is possible to download and run itunes from an external harddrive.
    I have a lot of music and would not like it to be on my macbook's harddrive.

    The iTunes application needs to be on the boot drive, but you can put your media anywhere you wish. The easiest way is to just drag the entire iTunes folder (the entire folder, not just the iTunes Music folder) to your desired location. Then hold down the Option key while launching iTunes. You'll be given a dialog box where you can select the iTunes library you want to use. Navigate to and select the iTunes folder in it's new location.
    Note that this procedure assumes that all of your tracks are contained in the iTunes Music folder. If they're scattered around your drive, moving them becomes much more complex. And don't launch iTunes with the external drive not mounted or iTunes will default back to the internal drive. If it does, though, just mount the external drive and launch iTunes with the Option key again.
    Don't delete the tracks from the old location until you've confirmed that they're working correctly from the external drive.
    Regards.

  • Using photos from a external drive in iphoto

    I have 300+ gigs of pictures on an external drive (attached to my Airport Extreme) and I want to use iphoto to edit and sort these pics without moving them to my Macbook.
    Is this possible?
    Thanks,
    Scott

    Scott:
    Yes it is. You can do it one of two ways:
    1 - create a new library on the external HD and import the folders into the library. As you import each folder and confirm that the files are safely copied into iPhoto, you can delete the original folder. Be sure to set up the Events preferences as seen here. This will insure that each folder will be imported as a single event and maintain your folder organization. This is the preferable way. The library would not be available when the external HD is not mounted.
    2 - create an alias based library (don't check the checkbox to copy the files on import) on your boot drive, set the Event preferences as before and import the folders from the external HD. This will put alias files in the originals folder of the library instead of copying the actual files. There are caveats to this method. If the HD is not mounted only the thumbnails and edited files will be viewable. You cannot have any movie files in the library as iPhoto insists on verifying their link before you can use the library. Not like the stills. Any photo you delete from the library will not be deleted from the source files on the external HD. That must be done via the Finder. If, while using the library, the HD gets dismounted the library's database file could be damaged and you'd lose all of your organizational effort. That could be averted by following the tip at the end of my signature. (It applies to normal libraries also). You cannot move or rename any of the source files once they've been added into the library. That's a big NO-NO.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've written an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Install / Use Organizer from an External Drive

    Am I able to install and use the Elements Organizer on an external hard drive? I don't want to keep all my images on my laptop HD.
    Am I able to put the images on the ext. HDD and then 'point' Organizer at them ~ OR ~ am I able to simply put the Elements Organizer
    Application on the ext. HDD and load images into it and then be able to access it from my laptop? 
    I'm not able to locate a Discussion Group specifically for Elements Organizer. (?)

    Hi,
    You've posted on the right forum
    You should install PSE on the laptop hard disk and may have all your images on the external hard disk or local hard disk. Now in Organizer, you may import media from local/external hard disk. Organizer only keeps only references (image path, to be precise) only and hence your images may reside on external hard disk.
    Thanks
    Andaleeb

  • Using Resources from dll!!

    hello dev.
    can we use the resource from the resource only dll.....

    can we use the resource from the resource only
    dll.....Hello!
    What exactly do you need to extract?
    We tried extracting icons from Windows DLLs.
    You can see how we did it in WinPack for JNIWrapper (http://www.jniwrapper.com)
    Check the WinPack demo or WinPack sources (they are available).
    Good Luck!
    EToporov

  • How can i use projects from an external drive in iMovie 13?

    In iMovie 11´you were able via a button to edit movies from an external hard drive without needing to install those in your computer´s internal hard drive, but in iMovie 13´ you are not able to do that anymore.
    I love iMovie, because it simplicity to create and make movies and i love they added better performance for green/blue screening, but i found a problem, i have a hard drive of only 128 GB, and with my content the clips i have don´t fit in the internal hard drive so i can´t install those clips, please do something in iLife 13´and even in iWork 13´there aren´t all those options anymore that let you do your work, some people think apple is bad for work, but i always have been telling them that all Microsoft features are in Mac too but with simplicity but in the new lineup they aren´t, i love apple, i haven´t got any device that isn´t from apple even my mobiles.
    Please do something! ;(
    Message was edited by: HDBusiness

    Hi,
    Read this http://support.apple.com/kb/ht1449
    Jim

  • How do I use itunes from an external HDD on a new laptop?

    This really does seem to be an unanswerable question but you guys have helped so many times in the past without me ever having to post.
    Here is my set up when I first got iTunes way back I had it on my first laptop, we'll call this PC A, but the Hard Drive was so small I moved the library to my external HDD. I say I moved it, a friend did it for me.
    For years this set up worked fine, iTunes was on the HDD and I would access it via PC A as long as the two were connected. If the HDD wasnt connected then I couldnt access iTunes, of course, as all of the library was stored on the HDD.
    I dont want to sound like I am talking to you all like idiots but Ive explained this so many times and people never know what I mean.
    So now I get another laptop. (PC B)  but obviously I cant get to iTunes from it even when the HDD is attached.
    For years I used to crank up old PC A and get to iTunes that way but now the old girl is on her last legs so I need to be able to access iTunes from PC B (this has been going on so long Im now looking for PC C).
    I do have iTunes on PC B that my iPhone is synced to and they seem to understand that each other exists but if I plug my iPod that is synced with iTunes from PC A with PC B it wipes it
    Please. Please. I just need to know what to do

    Make a split library portable
    Here are the typical layouts for the iTunes folders:
    In the layout above, with the media folder (everything in the red box) inside the library folder, the library is considered to be portable. A portable library can be moved from one path to another without breaking the links between the library and the media and being self-contained is much easier to backup.
    You can rearrange things to make a split library portable by taking a number of small steps which don't break the library.
    Before you start any media files that are outside of the media folder will need to be consolidated. If the library is in the old style layout then it should ideally be be upgraded to iTunes Media Organisation (Library > Organise Library > Rearrange files in the folder <Media Folder>) to ensure that iPod Games, Mobile Applications etc. are brought inside the media folder.
    The basic non-fatal manipulations are:
    You can connect to an alternate set of library files by holding down Shift (Win) or Option (Mac) when starting iTunes.
    You can move the library files to a new location as long as the media stays put.
    You can move the library files and the media together if the media folder is a direct subfolder of the library folder. (I.e. in this form the libary is portable).
    If you have already moved/copied the media content from a subfolder of the library folder to a different location then you only need to copy the library files for it to appear as if you have moved the entire library in the way allowed above. I.e. just copy the library files into the parent folder of the media folder.
    You can rename the media folder to iTunes Media (if it isn't already) if the media folder is inside the library folder.
    iTunes uses the name of the folder holding the library files as the window title. Having made a library "portable" you may need to take a final step of renaming the library folder to iTunes or, if the library files have ended up at the root of a drive, moving all of the library files and content folders into a new folder called iTunes.
    After each change you need to open, test and close the relevant library before attempting another change. If a change broke the library, undo it or revert to using the previous set of library files.
    In essence all you need to do to make your library portable is copy the library files into the parent folder of the media folder on the external/secondary drive and use the hold-down-shift/option-when-starting-iTunes method to connect to it. Other manipulations may be required to normalize the library so that the library and media folders have standard names.
    If you are making the library portable in advance of migrating it from one system to another, don't forget to deauthorise the old computer if you're not planning to use iTunes on it again.

  • How do I stop firefox from attaching to and using resouces from my external hard drives. Why is it doing this. I don't like it.

    I cannot disconnect from external hard drives because firefox is using the drive. I really don't like this. Aside from being intrusive and inconvenient it seems spywarish or just plain data mining.

    Try the solution here: [[/questions/768100]] Why does firefox want to use different fonts on mounted hard drives
    Move all User fonts in Font Book to Computer fonts.
    # Launch Font Book (/Applications/Utilities/)
    # Open Font Book > Preferences
    # Deselect: "Automatic Font Activation"
    # Set the "Default Install Location" for fonts to "Computer"
    # Select all User fonts
    # Move the selected User fonts to Computer fonts
    # Remove all duplicate fonts in Computer fonts

  • Using resources from webcenter 11.1.1.2

    Hi everybody,
    I'm working on webcenter 11.1.1.5 and I want to use the page template defined in webcenter 11.1.1.2 which does not provide the possibility to manage resources.
    How can I do ??? (implementing a page template from scratch ???
    Thanks for your help.
    Edited by: nfatmi on Mar 2, 2012 3:15 AM

    The simple thing would be ,
    1)Open the 11.1.1.2 project in jdeveloper 11.1.1.5.0 version.It will ask you to migrate the files in 11.1.1.5.0 format,accept it.
    2)Run the application , if it is running then it's okay for you. And if not running then copy the template code and it's corresponding page defination file, and paste both the files in your 11.1.1.5.0 project's template.And create portal resources in jdevoper itself.
    Hope it is clear for you. This is not a solution but a workaround.
    Regards,
    Hoque

  • Help with using iphoto from an external hard drive

    As my iphoto library became too big for my Powerbook I have moved picture folders to an external drive then deleted them from the PBook. My situation now is that I have created a new library on the external drive after having moved all my pictures to that drive and then moved folders from the old library into the new library and iphoto is not seeing any of the photos. Any ideas, please?

    ScottJD
    Welcome to the Apple Discussions.
    Here's the correct way to move the Library:
    1. Quit iPhoto
    2. Copy the iPhoto Library Folder as an entity from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching iPhoto. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.
    My situation now is that I have created a new library on the external drive after having moved all my pictures to that drive and then moved folders from the old library into the new library
    You did all this using the Finder? I'm afraid you've destroyed your old library. You'll need to create and populate a new library:
    To create and populate a new library:
    Note this will give you a working library with the same film rolls and pictures as before, however, you will lose your albums, keywords, books, calendars etc.
    Move the iPhoto Library Folder to the desktop
    Launch iPhoto. It will ask if you wish to create a new Library. Say Yes.
    Go into the iPhoto Library Folder on your desktop and find the Originals folder. From the Originals folder drag the individual rolls to the iPhoto Window and it will recreate them in the new library.
    When you're sure all is well you can delete the iPhoto Library Folder on your desktop.
    In the future, in addition to your usual back up routine, you might like to make a copy of the library6.iPhoto file whenever you have made changes to the library as protection against database corruption.
    Regards
    TD

  • Using users from an external table in the BI Publisher add-in for Word

    After installing the BI Publisher add-in in Word, I find that I can connect to BI Publisher (http://hostname:9704/xmlpserver) only using IDs that are defined within WLS. I'm using an Oracle database table and external authentication to get my users logged in to the Answers environment, and they use the BI Publisher features of Analytics as well. But if I try to connect from the add-in to xmlpserver as one of those externally authenticated users, it fails.
    Do I have to create new users in WebLogic Security for those folks who need to build BIP templates in Word? If not, how can I get the add-in to recognize and use the external table authentication?
    I'm in 11.1.1.6.2 BP1, but I've noticed the problem for a long time, possibly back to 10g.

    As you probably noticed, your formulas won't import into Project Siena - only the data.
    I've created a sample application for you to demonstrate how you create formulas in Project Siena.
    Here's the link to the project:
    https://onedrive.live.com/redir?resid=D64FC13017F614FD!47783&authkey=!AN3UxGDTP1vNbbU&ithint=folder%2cjpg
    In this example, I'm doing the heavy lifting on the Calculate button.
    Here's what I did to create the project.
    I added two input text boxes for height and weight
    I added a calculate button.
    I added a label to display the result.  In the Default Text I added
    BMI which is a context variable.  I could have called it BMIResult - it's up to you.
    Here's the formula for OnSelect of the Calculate button:
    UpdateContext({BMI: Round((Value(txtWeight!Text) / Value(txtHeight!Text * txtHeight!Text)), 2)*703})
    Note: If you haven't done so already, click 'Express View' in the lower right hand corner to see the properties.
    UpdateContext is a formula that is used to change results - in this case the variable, BMI.
    I used the Round function so it displays 2 digits for the decimal.
    I used the Value formula to convert the input boxes to numbers.
    This should get you started in the right direction - let me know if you need further explanation.
    One more thing to add - when creating a context variable, you will see a yellow exclamation mark until you have a formula that references it.
    Thor

  • How can i use Itunes from an external drive

    How can I install iTunes on to an external drive an use as my master librarian for music and movies, it must pretty simple, thanks guys!

    Hi,
    Read this http://support.apple.com/kb/ht1449
    Jim

  • How to include external .jar libraries

    hi,
    I'd like to use an external .jar library in my Java program.
    I import the package in the source code.
    But where do I have to specify the file location of the .jar file. Do I have to add its directory to the PATH environment variable or somewhere else??? So far I've done this only in Eclipse, but now I'm working in a pure linux environment... with no IDE.
    Thanks :)

    Or specify the classpath completely when you run javac.
    For example to compile a class called Foo in the current directory which uses classes from an external jar file I would say
    javac -cp .:../../whatever.jar Foo.javaAnd if Foo has a main() class:
    java -cp .:../../whatever.jar Foo(If you are working with a number of projects each with lots of classes and lots of (different) jars, it might be time to look at Ant.)

  • Read images from external jar file (Sun's Java L&F Graphics repository)

    Hi!
    I don't know how to read images from an external jar file. Sun has a Java Look and Feel graphics repository that contains a lot of good images that can be used on buttons and so on. This repository is delivered as a jar file, containing only images, and I want to read the image files from that jar file directly without including them inside my application jar file. The application and image jar files will be in the same directory.
    I have absolutely no clue how to solve this. Is it necessary to include the images inside my application jar file or is it possible to have them separate as I want.
    Would really appreciate some help!
    Best regards
    Lars

    Hi,
    There is two ways :
    1) Add your jarfile to the classpath.
    Use the class loader :
    URL url = ClassLoader.getSystemResource("your/package/image.gif");
    Image im = (new ImageIcon(url)).getImage();
    or
    Image im = Toolkit.getDefaultToolkit().getImage(url);2)If you don't want to add the jar to the classpath you can use this (under jdk 1.4):
    import java.util.*;
    import java.util.jar.*;
    import java.awt.*;
    import java.io.*;
    import java.awt.image.*;
    import javax.imageio.*;
    public class ImageUtilities {
         public static Image getImage(String jarFileName, String fileName) {
              BufferedImage image = null;
              try {
                   JarFile jar = new JarFile(new File(jarFileName), false, JarFile.OPEN_READ);
                   JarEntry entry = jar.getJarEntry(fileName);
                   BufferedInputStream stream = new BufferedInputStream(jar.getInputStream(entry));
                   image = ImageIO.read(stream) ;
              catch (Exception ex) {
                   System.out.println(ex);
              return(image);
    }I hope this helps,
    Denis

Maybe you are looking for

  • Session Time Out For UNLOGGED USER During Search -pls help

    Hi, The problem lies in searchresultscontroller.java/searchcontroller.java file under search/web/handler of an application that supports educational note sharing. The problem is that - When I search with query strings in different fields(as you will

  • DEADLOCK DETECTED ( ORA-00060 )

    Hi, We are getting deadlocks when the System (Exteranl-Portal- Production) Cache Upload process runs. It's Looks like application problem. We have been getting this deadlock problem whenever the CACHE job gets executed. Basically its a portal SRM Bus

  • Adapter Monitoring in RWB

    Hi- I am having a IDOC to File scenario, The scenario was working fine but all of a sudden i am unable to send the File out,i don't see any errors in the Monitor.But the file is not present in the file system.So i went to RWB and clicked on adapter m

  • Is there a text to speech app that can read text books to me?

    Is there a text to speech app that can read text books to me?

  • Line wrap in JTextField...

    Hi everyone.. I noticed that JAVA recognizes the line wrap in the JTextField if i paste a text with 2 lines....the text in the component appears with 2 lines because of the line wrap... how can i solve this?? i don�t want that the line wrap is showed