Finding jar location

How can I find the location of the jar containing my code? My program has to examine a local file folder relative to the location of the jar (thus "current directory" doesn't cut it).
One solution would be simple to pass the jar location as a system variable, though this is certainly not my first choice. Any ideas?

Hmmm...I'd hoped that it was simpler than that. Or maybe my question wasn't clear. Say the following code is contained in jar file MyProgram.jar--
  File fPath = getLocationOfJarFile();//where this returns the folder containing MyProgram.jar
  fPath = fPath.getParent();
  fPath = new File(fPath.getCanonicalFilePath() + "\\lib\\ext"));I now have the path that I need, found relative to the jar file containing my code.

Similar Messages

  • Oracle Test Harness - ectest.jar location

    Hi,
    I've read the article named "Out-of-Container EJB 3.0 Testing with Oracle Entity Test Harness (by Debu Panda)" in http://www.oracle.com/technology/pub/articles/debu_testability_of_ejb.html.
    Where is it supposed to be locate the ectest.jar file???
    I've just downloaded Oracle Toplink DP4 and OAS 10.1.3 DP4 but I can't find it.
    Thanks in advanced.

    Hi Bjorn,
    I've posted the same question a couple of time (see out-of-container Oracle EJB30 Test - ectest.jar location but nobody seems to know the answer.
    Please let me know ([email protected]) if you get to know where is the ectest.jar file located (the same way, I'll tell you if I do).
    Thank you very much.

  • In Mountain Lion, how do I find the location of an open Preview File?  The file "properties" tab is no longer available.

    I typically have several open Preview files at any one time and often forget where, sometimes if, I saved them.  In Mountain Lion, how do I find the location of an open Preview File?  Tried holding option + command in spotlight but I don't see a path name appear anywhere. 

    Yes, cmd-option on a file you choose in Spotlight and the path will appear at the bottom of the Preview window.
    EDIT: Also, if it is bookmarked the path is in Bookmarks.

  • Help needed in Finding Download location for Sun One Portal 7

    Hi,
    help needed for finding download location for Sun ONE Portal 7. I tried to find in Oracle Download page ,
    http://www.oracle.com/us/sun/sun-products-map-075562.html, But unable to find.
    Please share the link for download location.
    I am totally new in Sun ONE Portal.
    Thanks,
    Edited by: 945439 on Oct 5, 2012 3:41 AM

    try edelivery.oracle.com under sun products.

  • Every time I ask Siri to find something near me, she says that she cannot find my location, and to turn on my location settings and siri settings. These are both on and after rebooting it still doesn't work. How do I fix this?

    Every time I ask Siri to find something near me, she says that she cannot find my location because I need to turn on location services in the settings menu and in siri. These are both on, and after rebooting my phone it still doesn't work correctly. How do I fix this?

    No, the app does not have to completely restart. It gets shifted in its open state into storage. Similar to how a computer uses the hard disk when it has insufficient memory.
    What complicates things is that sometimes memory does not get returned for reuse when you close an app. Thus yo should periodically double click the Home button and "delete" unnecessary apps from the multitasking dock and power off and then back on the iPod.

  • How can I find the location of an app on my iPad 2?

    How can I find the location of an app on my iPad 2? The app comes up with a search, but that seems to be the only way to find it. I just installed the app today, but I can't figure out where it is. It has a pretty distinctive icon, and I've looked through all of my apps and even in folders (even though I don't know how it would have gotten there). I want to put it in an appropriate folder under the right subject, but I can't find it to do this. I can use the app, since I can find it through a search though. I have a lot of apps, but I looked very carefully and can't find it. Is there a way to ask my iPad to locate it for me? It's a $25 app and one I plan to use regularly, so I want it located in the folder of my choice.This problem makes we wonder if I have other "missing" apps, apps that I could  find if I happened to think to search for them, but that don't appear to be on my iPad (even though they actually  are).

    You were right about the homescreens. I had turned my iPad off for the night with less than three full homescreens of loose apps, those not in folders. When I turned the iPad on this morning to try your suggestions, I had five full pages of loose apps. They just appeared when I restarted, and there was the app I was looking for, easy to find. Last night I was deleting apps I decided I wouldn't use, organizing useful apps into folders, and making sure I had as few pages as needed by making sure the gaps made by the moved/deleted apps were closed. The missing apps didn't show up at that point; I was just left with fewer than 11 pages. The apps only showed up when I restarted this morning. There were almost three extra pages of apps that weren't there last night. I know there must be other things missing, since all of the pages are full. So I tried your suggestion in iTunes. I connected my iPad, found an app in the alphabetical list on the left, and double clicked it. This brought me to the app's homescreen (and its home folder when applicable), the place where it was located. In order to identify which page that was, I had to scroll through the screen shots of the homescreens that was below the homescreen that was showing until I found the homescreen whose number was in white. Then I could count the pages on my iPad until I got to that page. I'll have to delete more apps and organize more into folders to see what else might show up. There are just too many apps available for special education, and I'm in the process of figuring out which are the best for my needs. Thanks so much!

  • How do I use Spotlight to find the location of a document?

    Spotlight used to show the location of document when I hovered the mouse over an item in its list. It no longer does this. Now it tells me that a document exists and allows me to open the document, but doesn't tell me where to find the document. How do I use Spotlight to find the location of a document?

    Hi Thomas ...
    Open System Preferences > Spotlight then select the Search Results tab.
    Select the all the categories for the search results you want.
    Restart your Mac.
    If that didn't help the Spotlight preferences may be corrupted.
    Go to ~/LIbrary/Preferences
    Move the com.apple.spotlight.plist file from the Preferences folder to the Trash.
    Try Spotlight.
    edited by:  cs

  • My ipod touch no longer finds my location via my router after ios 5 update

    After I updated my ipod touch to ios5 it can no longer find my location when its on wifi using my airport express router . It has no problem when I'm using another router in another physical location... it finds its location perfectly. Only has a problem using my router at on home on my wifi network. I've seen posts online about this problem but no clear solutions. I've tried re-setting both devices as well as registering the router on skyhook but to no avail. Does anybody have any ideas about how to work around this.

    - Apple no longer uses Skyhook. They have their own database and they update it from data they optain via iPhones. No one has found a way to tell Apple to add or update a router location.
    - Power off and then back on the router.
    - Reset networks settings: Settings>General>Reset>Reset Network Settings

  • Nmew32rg.dll - Unable to find EM location in the registry : RegQueryValue f

    Hi All,
    I am getting below error while installing companions "10203_vista_w2k8_x86_production_companion.zip" (32-bit) (HTTP server) on Windows 2008 sp2 64-bit machine.
    .....CALL INTO REGISTRY.....
    DLL TO LOAD = \nmew32rg.dll
    DLL LOADED
    Unable to find EM location in the registry : RegQueryValue failed
    REGISTRY VALUE = nullThis happens only if I do installation from command line by using response file. From OUI interactive installer it is being installed properly.
    ORACLE_HOME (db) = C:\oracle\Database\oracleDB\
    ORACLE_HOME=C:\oracle\Database\oracleDB\OHS
    Companion disk:           C:\oracle\Oracle10g\companion
    Modified response file:   C:\oracle\Oracle10g\companion\oracle.companionCD.midtier.rsp
    Command to install:
    "C:\oracle\Oracle10g\companion\install\oui.exe" -silent -nowait -force -waitforcompletion FROM_LOCATION="C:\oracle\Oracle10g\companion\stage\products.xml" ORACLE_HOME=C:\oracle\Database\oracleDB\OHS ORACLE_HOME_NAME=oracle_10gOHSHome -responseFile C:\oracle\Oracle10g\companion\oracle.companionCD.midtier.rspThe machine already has "10204_vista_w2k8_x64_production_db.zip" database installed.
    Can you please suggest what additional things I need to take care to install companions using response file?

    Thanks Werner for reply !! I was really looking for any reply of my thread.
    I think it is useless to mention because something I did which is not supported,
    1. I installed "10204_vista_w2k8_x64_production_db.zip" database on w2k8 sp2 (64-bit) machine which is supported DB version for w2k8 environment.
    2. Companions are available for w2k8 64 bit but HTTP server is not there. It is only available in "10203_vista_w2k8_x86_production_companion.zip". This is a x86 (32-bit) setup and while doing interactive mode installation it is passing all prereq checks on x64 and not showing me any information to not to use this setup for x64. Also, it works fine after installation but not working in command-line installation.
    One last question,
    Will Oracle provide support on fixing this issue if I contact them or raise SR ?

  • How can I find the location of the signature used in the Adobe Reader signature feature?

    How can I find the location of the signature used in the Adobe Reader signature feature? I've been using the signature feature for a while now and it works great and I'd like to use it on another computer. However, I forgot where I stored the signature. Adobe finds it with no problems (the signature pops up when I click "Place Signature"), but I have no idea where it is.

    Hello,
    It's here - C:\Documents and Settings\username\Application Data\Adobe\Acrobat\10.0\Security\
    For more information, please refer - Cannot create a digital ID/signature
    ~Deepak

  • The search feature in Add Places cannot find any locations.

    When I try to add places, the search feature cannot find any locations. I can, however, drag and drop photos onto locations on the map. I've tried contacted support twice and they have not been helpful at all. I would appreciate any help.

    You installed a search plugin. Why not look for it the search bar?
    https://support.mozilla.com/en-US/kb/Search+bar

  • Its urgent  how to use calss file of jar located in lib folder

    how to use calss file of jar located in lib folder.
    i want to use RowSetDynaClass class which is in beanutil jar file which is in my lib folder .if i use that class in my jsp following error is coming.
    Class RowSetDynaClass not found.
    RowSetDynaClass resultSet = new RowSetDynaClass(rs, false);
    how to access class in jar file.
    please help

    You have to either refer to the class in its fully quallified name, or import it into the JSP:
    <%
      some.full.packagename.RowSetDynaClass resultSet = new some.full.packagename.RowSetDynaClass(rs,false);
      ...-or-
    <%@ page import="some.full.packagename.RowSetDynaClass" %>
    <%
      RowSetDynaClass resultSet = new RowSetDynaClass(rs, false);
      ...As long as the class has public visibility and you have re-started the server/servlet context since you added the JAR.

  • How can I find the location of an i-pod shuffle, nano and touch that i have synced to my account? I have had each one stolen and would be so relieved if i could track there location as I know they are still in the county I live.

    How can I find the location of an i-pod shuffle, nano and touch that i have synced to my account? I have had each one stolen and would be so relieved if i could track there location as I know they are still in the county I live.
    Also if i cant locate them can i at least remotely delete the libraries, and lock them so they are unusable to the thiefs, and i had a sony laptop worth £2000 stolen which I had used my apple account for a year is there anyway i can track that or retrieve the contents and delete them?
    Please if anybody knows reply or contact me!!!! =-)
    many thanks

    You or Apple can do nothing to prevent use of the devices.
    For the iPod touch if you turned on the FindMyiPod feature and wifi is on and connected yu may be ablt ot locate it and wipe it by going to iCloud, signing in and going to FindMyiPhone. However, if the iPOd is rectored that feature is deleted.
    Report to police and change the passwords for all accounts used on the iPod.

  • HT204053 Why can't Find iPhone locate all my devices ?

    Why can't Find iPhone locate all my devices ?
    It finds my iPhone, iPod, and only one of 2 iPads.
    Sometimes, only finds iPhone and iPod only.
    I don't use iCloud...had very bad experiences with it !!!
    Lost all my Contacts and had duplicates and triplicates of entries in my Calender.
    Took a long time to get back to "normal"
    Stays far away from iCloud now !

    Find My iPhone relies on iCloud.  (It used to use MobileMe and may still do that, but that service is going away at the end of June, so you need your iCloud account for Find My iPhone.)

  • Hi, my Iphone was stolen 2 days ago, I have the voxer installed on it, is it possible to find the location of my phone?

    Hi, my Iphone was stolen 2 days ago, I have the voxer installed on it, is it possible to find the location of my phone?

    What is the "Voxer"?
    If you set up the find my iphone feature on the iphone itself and it is on and it has not been restored, then you may be able to locate using icloud.com.
    Otherwise, it cannot be tracked.

Maybe you are looking for