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?

Similar Messages

  • How can I view information about an image, such as the file name and exposure,  on the Ipad?

    how can I view information about an image, such as the file name and exposure,  on the Ipad?

    You can't with the built-in Photos app, but there are apps such as iPhoto which allow you to see the exposure details (aperture, shutter speed, focal length, ISO). PhotoMeta also shows you that info

  • Loading property files from a class and not a servlet...

    Hi, I was wondering if anyone has a good solution for loading property files from a class instead of a servlet. I would like to load the property file similarly to how it is done from HttpServlet.
    Here is the large picture. I have a tag library that calls a class which needs to access a database. The class needs to know what DB to access so it needs to look at some property file. The problem is that I don't want to hardcode the properties or the path of where the property file exists. I hope this all makes sense.
    Thanks.
    -PV

    I use the getResource method in the java.lang.Class class. Read about this method in the api.
    Anyways this is roughly how it's : you must put your properties file in the classpath. Then in your class :
    Properties prop = new Properties();
    URL url = this.getClass().getResource("/config/db.properties");
    prop.load(url.openStream());In this case, you must put the "config" (where you've written your db.properties file) directory's parent in the classpath.

  • How do I load microsoft office and pdf files onto an Ipad

    How do I load microsoft office and pdf files onto an Ipad?

    You can email them, you can use DropBox, SugarSync or another cloud service or you can use iOS file sharing.
    But in all cases you need an app on the iPad that will open and save those types of files. iBooks, Adobe Readers, Good Reader and Save 2 PDF will all save PDF files.
    Documents to Go, Quick Office Pro and the Apple iWorks apps will open and save the MS office files. You can Google - "iPad apps that are compatible with Microsoft Office files" and you will find other alternatives - or search the app store for more.
    You can read this as well for some instruction on getting those files onto an iPad.
    http://online.wsj.com/article/SB10001424052748703899704576204564046912604.html

  • How can I load a CMYK jpeg image

    How can I load a CMYK jpeg image (originally saved from Photoshop) and then
    turn it into an rgb BufferedImage, in order to display it on screen in an
    applet?
    I first tried ImageIO.read(), but that does not work for cmyk jpegs. I then
    looked into the com.sun.image.codec.jpeg package, and tried methods like
    decodeAsBufferedImage() and decodeAsRaster().
    The first one (decodeAsBufferedImage) returned an image, but it seems that
    it was interpreted as an ARGB, and the colors were incorrect.
    I then read the documentation which (amongst many other things) stated that
    "If the user needs better control over conversion, the user must request the
    data as a Raster and handle the conversion of the image data themselves."
    This made sense, so I took to decodeAsRaster(), only to find that I could
    not figure out how to carry out the desired conversion.
    Of course, I have looked into the documentation for BufferedImage, Raster,
    ColorModel, ColorSpace etc, but after a while I was lost. (Before I got lost
    I read that you can convert images with the help of methods like toRGB,
    toCIEXYZ.)
    I have a feeling that this is probably pretty simple if you just know how to
    do it, but I sure would need some directions here.
    Any help would be appreciated. Thanks.

    You can either use the "Place" command from the main menu, under "File", or you can just open it, select the move tool "V", the click in the image and drag it to the other file's tab.

  • How can you change property files of a EJB at Runtime?

    Hi,
    I have got an ejb and want to change my variables which I stored in property file at Runtime.
    But the property file isn´t in the jar-file of my ejb...
    How can I add it.
    Or How can I change the property file without new compilation.
    Thanks
    Uli

    Hi Uli,
    the previous post is generally correct, but without taking any part in the sensibility of this (there are valid reasons why you would not store the values in a DB) it would be necessary for you to be a bit more specific.
    Is your problem that you can not see the file from your EJB or that you don't know how to change a property file entry in general?
    Cheers,
    Kalle

  • How can I do to acquire and save date in the same time and in the same file when I run continual my VI without interrupti​on.

    I've attached a VI that I am using to acquire amplitude from Spectrum analyzerse. I tried to connect amplitude ouput to the VI Write Characters To File.vi and Write to Spreadsheet File.vi. Unfortunately when I run continual this VI without interruption, labview ask me many time to enter a new file name to save a new value.
    So, How can I do to aquire and save date in the same time and in the same file when I run continual my VI for example during 10 min.
    Thank you in advance.
    Regards,
    Attachments:
    HP8563E_Query_Amplitude.vi ‏37 KB

    Hi,
    Your VI does work perfectly. Unfortunately this not what I want to do. I've made error in my last comment. I am so sorry for this.
    So I explain to you again what I want to do exactly. I want to acquire amplitude along road by my vehicle. I want to use wheel signal coming from vehicle to measure distance along road. Then I acquire 1 amplitude each 60 inches from spectrum analyzer.
    I acquire from PC parallel port a coded wheel signal coming from vehicle (each period of the signal corresponds to 12 Inches). Figure attached shows the numeric signal coming from vehicle, and the corresponding values “120” and “88” that I can read from In Port vi.
    So I want to acquire 1 time amplitude from spectrum analyser each 5
    period of the signal that I am acquiring from parallel port.
    So fist I have to find how can I count the number of period from reading the values “120” and “88” that I am acquiring from In Port (I don’t know the way to count a number of period from reading values “120” and “88”).
    Here is a new algorithm.
    1) i=0 (counter: number of period)
    2) I read value from In Port
    3) If I acquire a period
    i= i+1 (another period)
    4) If i is multiple of 5 (If I read 5 period)
    acquire 1 time amplitude and write to the same
    file this amplitude and the corresponding distance
    Distance = 12*i). Remember each period of signal
    Corresponds to 12 Inches).i has to take these
    values: 5,10,15,20,25,35,40,45,50,55,60............
    5) Back to 2 if not stop.
    Thank you very much for helping me.
    Regards,
    Attachments:
    Acquire_Amplitude_00.vi ‏59 KB
    Figure_Algorithm.doc ‏26 KB

  • How do i after down load creative cloud and have it in the tool bar , then click on it ,it brings up a box  called creative cloud then just rotates not bringing up any apps ?

    how do i after down load creative cloud and have it in the tool bar , then click on it ,it brings up a box  called creative cloud then just rotates not bringing up any apps ?

    Mac Spinning Wheel https://forums.adobe.com/message/5470608
    -Similar in Windows https://forums.adobe.com/message/5853430

  • Images (and image folders) in the same folder as Lightroom Catalog?

    I'm just switching over from Aperture 3 to Lightroom 4.  I'm wondering if its ok (or smart) to keep the images (and image subfolders) in the same folder that the Lightroom.lrcat and Previews files are kept in.  I'm trying to better organize my Pictures folder so that there are a whole bunch of separate sub-folders.  Thoughts?

    In Lightroom, there is no specific location where the photos should go. You can put them wherever you want, based upon your storage needs and hard drive setup.
    So, with regards to your specific question, yes you can put the photos in the same folder as where the .lrcat is located, I can't see any harm, but I also don't think you need to do the work to make that happen. You can pretty much leave your photos where they are (which is easier and less time consuming) than moving them to the .lrcat folder, and easier and less time consuming than moving them at all.
    In fact, I strongly suggest you change your thought processes from "Where do I put my photos" to "How can I organize my photos". Now that you are a Lightroom user, you organize your photos from within Lightroom, not by moving them here to there, but by adding keywords and other metadata. Organizing, now that you are LR user, is not folders ... it is metadata. Searching, now that you are a LR user, is not done in your operating system and in folders, it is done in LR by searching for keywords and other metadata.

  • I think my iMac got virus on my iMac through opening an email from Facebook on Safari, anyone knows how to do a complete erase and clean up of the iMac?

    I think my iMac got virus on my iMac through opening an email from Facebook on Safari, anyone knows how to do a completely erase and clean up of the iMac?

    Things You Can Do To Resolve Slow Downs
    If your computer seems to be running slower here are some things you can do:
    Start with a visit to: OS X Maintenance - MacAttorney.
    Boot into Safe Mode then repair your hard drive and permissions:
    Repair the Hard Drive and Permissions Pre-Lion
    Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    Repair the Hard Drive - Lion
    Boot from your Lion Recovery HD. When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported, then click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu. Select Restart from the Apple menu.
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Restart your computer normally and see if this has helped any. Next do some maintenance:
    Suggestions for OS X Maintenance
    For situations Disk Utility cannot handle the best third-party utility is Disk Warrior;  DW only fixes problems with the disk directory, but most disk problems are caused by directory corruption; Disk Warrior 4.x is now Intel Mac compatible.
    OS X performs certain maintenance functions that are scheduled to occur on a daily, weekly, or monthly period. The maintenance scripts run in the early AM only if the computer is turned on 24/7 (no sleep.) If this isn't the case, then an excellent solution is to download and install a shareware utility such as Macaroni, JAW PseudoAnacron, or Anacron that will automate the maintenance activity regardless of whether the computer is turned off or asleep.  Dependence upon third-party utilities to run the periodic maintenance scripts was significantly reduced since Tiger.  These utilities have limited or no functionality with Snow Leopard or Lion and should not be installed.
    OS X automatically defragments files less than 20 MBs in size, so unless you have a disk full of very large files there's little need for defragmenting the hard drive. As for virus protection there are few if any such animals affecting OS X. You can protect the computer easily using the freeware Open Source virus protection software ClamXAV. Personally I would avoid most commercial anti-virus software because of their potential for causing problems. For more about malware see Macintosh Virus Guide.
    I would also recommend downloading a utility such as TinkerTool System, OnyX 2.4.3, or Cocktail 5.1.1 that you can use for periodic maintenance such as removing old log files and archives, clearing caches, etc.
    For emergency repairs install the freeware utility Applejack.  If you cannot start up in OS X, you may be able to start in single-user mode from which you can run Applejack to do a whole set of repair and maintenance routines from the command line.  Note that AppleJack 1.5 is required for Leopard. AppleJack 1.6 is compatible with Snow Leopard. There is no confirmation that this version also works with Lion.
    When you install any new system software or updates be sure to repair the hard drive and permissions beforehand.
    Get an external Firewire drive at least equal in size to the internal hard drive and make (and maintain) a bootable clone/backup. You can make a bootable clone using the Restore option of Disk Utility. You can also make and maintain clones with good backup software. My personal recommendations are (order is not significant):
      1. Carbon Copy Cloner
      2. Data Backup
      3. Deja Vu
      4. SuperDuper!
      5. SyncTwoFolders
      6. Synk Pro
      7. Synk Standard
      8. Tri-Backup
    Visit The XLab FAQs and read the FAQs on maintenance, optimization, virus protection, and backup and restore.
    Additional suggestions will be found in Mac maintenance Quick Assist.
    Referenced software can be found at CNet Downloads or MacUpdate.
    Additional Hints
    Be sure you have an adequate amount of RAM installed for the number of applications you run concurrently. Be sure you leave a minimum of 10% of the hard drive's capacity as free space.
    Add more RAM. If your computer has less than 2 GBs of RAM and you are using OS X Leopard or later, then you can do with more RAM. Snow Leopard and Lion work much better with 4 GBs of RAM than their system minimums. The more concurrent applications you tend to use the more RAM you should have.
    Always maintain at least 15 GBs or 10% of your hard drive's capacity as free space, whichever is greater. OS X is frequently accessing your hard drive, so providing adequate free space will keep things from slowing down.
    Check for applications that may be hogging the CPU:
    Open Activity Monitor in the Utilities folder.  Select All Processes from the Processes dropdown menu.  Click twice on the CPU% column header to display in descending order.  If you find a process using a large amount of CPU time, then select the process and click on the Quit icon in the toolbar.  Click on the Force Quit button to kill the process.  See if that helps.  Be sure to note the name of the runaway process so you can track down the cause of the problem.
    Often this problem occurs because of a corrupted cache or preferences file or an attempt to write to a corrupted log file.

  • At the top of my homepage, I'm getting a message "Downloading the latest applications", but the circle to the left keeps spinning, and no applications are downloaded. I don't know how to stop this, tried right and left clicking on the bar. This occurs

    At the top of my homepage, I'm getting a message "Downloading the latest applications", but the circle to the left keeps spinning, and no applications are downloaded. I don't know how to stop this, tried right and left clicking on the bar. This occurs every time I open Firefox. How can I stop or disable this?
    == This happened ==
    Every time Firefox opened
    == Several weeks ago.

    See http://kb.mozillazine.org/Software_Update (Software Update not working properly)
    Remove the files in the ''updates'' and ''updates\0'' folder:
    Vista/Windows7:
    C:\Users\<user>\AppData\Local\Mozilla\Firefox\Mozilla Firefox\ (updates)
    C:\Users\<user>\AppData\Local\VirtualStore\Program Files\Mozilla Firefox\ (updates)
    %LOCALAPPDATA%\Mozilla\Firefox\Mozilla Firefox\updates\

  • I will soon be purchasing a new PC running Windows 7. I need to know how to migrate my iTunes Library and apple devices to the PC. Is there a previously published support document on this topic? Thank You.

    I will soon be purchasing a new PC running Windows 7. I need to know how to migrate my iTunes Library and apple devices to the PC. Is there a previously published support document on this topic? Thank You.

    Connect a blank powered external drive to the PC.
    Right click on the Disk in the File manager and choose format: exFAT 
    (if it's a XP machine, first install exFAT from Microsoft and reboot)
    navigate to your user account folders on the PC and drag and drop copy (or copy and paste) to the external drive.
    (if a program has your files, then export them out first)
    Hook up the drive to the Mac, and transfer files to the desktop or to their same appropritate folders.
    Import photo's into iPhoto program, import music into iTunes etc and they will manage those files.
    You can continue to use the external exFAT drive between Mac's and PC's
    Do not format the drive NTFS or FAT, NTFS can't be written too by the Mac and FAT can't hold over 4GB sized files.
    If you format exFAT on the Mac, it likely won't work correctly on the  PC.
    "Migration" type programs are a utter waste of time and effort between PC's and Mac's for the fact that only certain files (and no programs or anything else) will work between them, also it's a hassle and takes too long. So don't even bother with it.

  • Have new iMac OSx10.8.2, and when I connected my Epson Stylus pro3880, loaded printer drivers, and tried to print, the printer utility opens, then crashes. Any ideas? (it worked fine on my last iMac)

    Have a new imac OSx10.8.2, and when I connected my Epson Stylus pro 3880, loaded print drivers, and tried to print, the printer utility opened and then crashed; happened several times. Any ideas? (it worked fine on my older imac)

    I believe so. the driver version I have is 8.64
    The person gave me the instructions to reset the printing system and I followed it. That's what corrected the printing drop down windows.
    I am also having trouble finding the downloaded icc profiles for the papers I use. I see them in the Color Sync Utility, but not in the drop down window for Color Management. There is a thread on this forum relating to that, but I don't understand how to "copy" the profiles and put them elsewhere.

  • How do I wipe everything off, and go back to the way the phone was set when I got it?

    How do I wipe everything off, and go back to the way the phone was set when I got it? I am thinking that might be the only way to fix my wifi issue. Thanks!

    Hello, if you havent tried the doesktop manager option, you can do it from the device aswell... Just make sure you save all your contacts to your SIM.
    you can go into your Security Options (in Options menu) and select wipe handheld.
    1). Please thank those who help you by clicking the beside the 'Reply' button.
    2). If your issue has been solved, please resolve it by marking "Accept as Solution" on the correct post!
    3). Remember to have fun! We are all in this together!
    4). Follow me on

  • I have just updated to iOS7, no icon for browser, was using Safari, how do I get it back and can I reverse the upgrade and go back to iOS6?

    I have just updated to iOS7, no icon for browser, was using Safari, how do I get it back and can I reverse the upgrade and go back to iOS6?  Thanks to you from the UnTechie

    The icon for Safari has probably moved to make room for new apps. Scroll the Home screen to look for it.
    You cannot reverse the upgrade.

Maybe you are looking for

  • My country is not listed in 1st generation iPod Nano replacement program

    Hello; When I first heard about the replacement program, there were no Apple stores in Turkey. So I couldn't get my replacement. Now we do have an Apple Store in İstanbul. Last week I went there with my 1st gen iPod nano and explained them the issue,

  • Can't get 2nd Monitor to Work

    I have a MacBook Pro 2.16 Core Duo. I also have a Dell LCD display, about 3 years old. I can connect the Dell monitor with a DVI cable, but the MacBook doesn't sense it. My only clue is that on the MacBook, there are four pins right by the horizontal

  • Problems inserting flash movies with DW CS 3

    I just started playing with DW CS3 and I got a feeling I'm doing something wrong here but when I go place a Flash SWF in a Dreamweaver HTML page the Flash portion of the page is not showing up when the site is placed on a sever and looked at over the

  • Table of Contents Web Part

    We have a website that builds a sitemap using the OOTB Table of Contents web part to build a Site Map. The site consists of several subsites and the site map is close but under one particular subsite though the site map shows duplicate links. As an e

  • Creating a Writable PDF

    Can I create a writable PDF using a word document that is a form?