Why $(dirname $0) not point my application to the right place?

Dear all,
I have a script file "myApp.sh" in a specific directory, say "/usr/myApp/bin". JDK is installed under "/usr/myApp/JDK". The script has the content as
#!/bin/sh
binDir=$(dirname $0)
${binDir}/../jdk/bin/java -classpath ${binDir}/../lib/myApp.jar myPackage.Main
Now if I run the scripts from somewhere, it tells me that
"/../jdk/bin/java can not be found ..."
It seems that int to the root directory "/" insteead of "/usr/myApp/bin". What is wrong?
Regards,
Pengyou

Hi, jverd and other friends,
Thanks for your kind help.
In fact, I want to deploy an application with
integrated JDK and make it independent of
installation path and other Java installation . I
believe this is related to Java application.
However, although I have some ideas, I am poor in
Unix shell scripts.
This is why I try to solve these problems step by
step by posting those questions recently.
Thx for your patience.
PengyouActually, these questions have nothing to do with Java. You could ask the same questions and get the same answers deploying any software written in any language.
I don't mind answering them if I can, but for shell script stuff, you'll probably have better luck on a site or newsgroup that focuses on Unix/shell topics.

Similar Messages

  • Why is fcpx not detecting ex hd in the right place?

    I've had this problem before but how come my external hard drive is being picked up as a camera. Its highly annoying when I try to import from a real camera and get dead slow when it starts loading video from my ex hd. and also I dont have the option of exporting projects and events to the ex hd. only to the internal hd.
    any ideas?
    so I'm having issues importing / exporting to an from external hard drive

    The root level is the only level that causes a problem. Open the hard drive and look at the folders at that very first level. If you have a folder titled "no_name" or "contents" or Private, or anything that FCPx thinks is an SD Card or other external hard drive, it will get confused and the drive won't show up. Put any such folders inside another folder and all is good (if that is indeed the cause of the problem).

  • Not sure if this is the right place...Recovery or Finding missing files

    Hi,
    Again, not sure if this is the right place to ask, but its worth a shot.
    so i've been transcribing video all day using microsoft office for mac, and was saving the project (i thought) to an external hard drive. at one point the HD came unplugged, and i plugged it back in. no big deal. i continued to save, to type, save, type, etc until finished. so when i finished and saved the project, seemed okay. when i closed word, it kept asking me if i wanted to save changes...i said yes, and it would just ask me again, did this a few times. i assumed it was asking me to save it to a new location, which i didn't think i needed so finally said no.
    i then find out that somehow when the HD was unplugged it erased Words ability to save to said location. so my last save was really before the HD was removed, which is odd, because i kept saving and never was prompted the path was interrupted or anything.
    so my question is two part...
    1. where would i find in the depths of the computer the saved files? if i was saving, they had to have gone somewhere, but i dont know how to find them.
    2. also, assuming it wasnt saving, my word prefs say it autosaves every 5 minutes, so those files must exist somewhere also, yet can't find them...
    does this make sense, can anyone help me?
    thanks
    austin

    Hi there,
    In Finder, select Go menu>Go to Folder, and go to "/volumes".
    Volumes is where an alias to your hard drive ("/" at boot) is placed at startup, and where all the "mount points" for auxiliary drives are created for you to access them. This folder is normally hidden from view.
    Drives with an extra 1 on the end have a side-effect of mounting a drive with the same name as the system already think exists.
    See if it may be in one of those with a 1 or 2 added to it.

  • Not Sure if This is the Right Place For this Question

    My question is, does anyone know why Sci-Fi and BSG was removed from the iTunes store?

    BSG is is owned by Universal/NBC, which took their football and went home.

  • Should I believe the advice on internet sites to speed up Firefox and if so, why are these not included in Firefox in the first place? Do you recommend any of these, or have any of your own?

    I have already asked my question on the previous page!
    == User Agent ==
    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4

    No. Many of those tweaks provide little, if any benefit, while others can get you banned from some websites for having too many connections to their website.

  • Help and I;m not sure if this is the right place

    I have a N900 and have just bought a Blueant S4 handfree unit
    It appears I cannot transfer my contacts.
    Does anyone know of a work around.....I am very techincally naieve.....
    Thanks

    not to be a bummer, but i believe that blue ant you are usung, you are going to want to transfer your copntacts to it to do the voice.
    i do not believe it will work as per the bluetooth stack in the n900 is not compatible to send contact information even out to its own blutooth devices.
    unfortunately, petrovich....which is now not nevessary to install by application because it iws now included with the firmware from pr1.2, will not allow you to send your contacts to the bluieant.
    if you are able to get yourr blueant to somehow get your contacts and take voice commands, please do share your instruction.

  • Help with this error not sure if this is the right place

    I am getting this error regularly on a thin client logged into the server at a customers location
    causing the application to lock up
    Log Name:      Application
    Source:        Windows Error Reporting
    Date:          2/23/2015 8:24:30 AM
    Event ID:      1001
    Task Category: None
    Level:         Information
    Keywords:      Classic
    User:          N/A
    Computer:      CWSERVER
    Description:
    Fault bucket , type 0
    Event Name: AppHangXProcB1
    Response: Not available
    Cab Id: 0
    Problem signature:
    P1: CounterWorks2.exe
    P2: 3.0.47.5
    P3: 5488beca
    P4: 4d61
    P5: 128
    P6: splwow64.exe
    P7: 0.0.0.0
    P8:
    P9:
    P10:
    Attached files:
    These files may be available here:
    C:\Users\CW\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppHang_CounterWorks2.ex_3bbf151e78710c4759ebe7b9e91676f5cd16934_11a2177c
    Analysis symbol:
    Rechecking for solution: 0
    Report Id: ac0cc479-bb67-11e4-b1a4-50e54980f26d
    Report Status: 0
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Windows Error Reporting" />
        <EventID Qualifiers="0">1001</EventID>
        <Level>4</Level>
        <Task>0</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2015-02-23T14:24:30.000000000Z" />
        <EventRecordID>151887</EventRecordID>
        <Channel>Application</Channel>
        <Computer>CWSERVER</Computer>
        <Security />
      </System>
      <EventData>
        <Data>
        </Data>
        <Data>0</Data>
        <Data>AppHangXProcB1</Data>
        <Data>Not available</Data>
        <Data>0</Data>
        <Data>CounterWorks2.exe</Data>
        <Data>3.0.47.5</Data>
        <Data>5488beca</Data>
        <Data>4d61</Data>
        <Data>128</Data>
        <Data>splwow64.exe</Data>
        <Data>0.0.0.0</Data>
        <Data>
        </Data>
        <Data>
        </Data>
        <Data>
        </Data>
        <Data>
        </Data>
        <Data>C:\Users\CW\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppHang_CounterWorks2.ex_3bbf151e78710c4759ebe7b9e91676f5cd16934_11a2177c</Data>
        <Data>
        </Data>
        <Data>0</Data>
        <Data>ac0cc479-bb67-11e4-b1a4-50e54980f26d</Data>
        <Data>0</Data>
      </EventData>
    </Event>

    Hi,
    You can have a look at below article might get some useful details from below links.
    1. Event ID 1001: Windows Error Reporting
    2. Event ID 1000, 1001 is logged every five minutes in the Application event log 
    As this is not related to RDC Forum for more accurate information you can place your question under “Windows Server General
    Forum”.
    Hope it helps!
    Thanks.
    Dharmesh Solanki
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Not sure if this is the right place, but I need help working with wtmpx

    I am trying to write a program that collects data from the /var/adm/wtmpx file and I would like to use the structures and functions provided by the utmpx.h file in /usr/include. I can read the utmpx file with no problem, however I would like to read the wtmpx file. I think the way to do it is to use the function utmpxname(). However, this appears to be the one function that doesn't seem to work. The compiler complains that there is no function utmpxname(). I am mainly a C++ programmer so this code is a little confusing to me. Where can I find the actual implementation of the utmpxname()? PLEASE HELP!!

    This is a Solaris question. You should post it to that discussion.
    Items in section 3 of the manual are not part of the compiler. They
    would be in libc or some other system lib distributed with
    the OS and not maintained under the compiler collection.

  • Not sure I'm in the right place. When I try to d/l a pdf (adobe reader x) I get a thing that says adobe   needs my permission to run but no way to permit. I   cleared  the security menu   thinking that might be the problem   but no joy.... Help!

    The title says it all.

    Question 1. I already asked this, Can I removed the Apple default apps?
    No. But you can turn off automatic syncing and Push email and set the phone to retrieve mail manually.
    Question 2. Can I control the way apps access the data network?
    Sort of. Turn on Airplane mode which will disable the cellular modem then turn on WiFi only. With Airplane mode ON and WiFi ON, your phone will only connect to the internet using an available WiFi connection.
    I can't find a way to prevent apps from using it or switching to it when my WI-FI drops momentarily.
    Apps do not run in the background so they only way an app can attempt to connect is if you have it running. If you do not run the app, it cannot run up your bill. For Apps that have "background" notification, you can turn that option off in the settings for each of those apps.
    Question 3. Is it possible for the mobile provider to turn my data network off while leaving the cellular network active?
    That is up to your provider. Call them. Go into Settings, General, Network, and turn OFF Data Roaming.
    Question 4. I'm trapped in a tough spot, is there something "technical" I can do, that I haven't mentioned bellow? There must be something to elevate the situation.
    In the US, you can return the phone within thirty days and void the contract. If you do not have that option, or if you are past thirty days, you can pay the ETF (Early Termination Fee) and void the contract.
    I live in a very rural area in the US and I have used all of the techniques listed above at different times. I hope this helps; I "get it" that a huge Surprise! data roaming bill at the end of the month can be upsetting. Try the stuff I listed above and if none of that works, paying the ETF might be cheaper than paying Surprise! bills every month.
    Hope this was helpful.

  • I'm not sure if this is the right place to post this question...

    The hard drive icon has mysteriously disappeared off of my desktop and I have NO CLUE how to get it back! I also added another hard drive and that icon as well, does not show up on the desktop. If I load a cd in the drive, it will show up - but my hard drive(s) won't.
    HELP!!!!
    G4   Mac OS X (10.4.8)  

    Try this:
    Repairing the Hard Drive and Permissions
    Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. Then select Disk Utility from the Installer menu (Utilities menu for Tiger.) 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. Now shutdown the computer for a couple of minutes and then restart normally.
    If DU reports errors it cannot fix, then you will need Disk Warrior (4.0 for Tiger) and/or TechTool Pro (4.5.2 for Tiger) 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.

  • Not sure if this is the right place...but is there any aggregate data repository/dictionary out there?

    And what I mean is...Is there any aggregate data dictionary out there that tells you how long and what type a data column should be?
    For example...Medical Provider Name...what is the normal length for something like this? Provider ID? Tax ID? Address Line 1? City? State?...Etc...
    Is like EDI X12 considered the Bible of Data Dictionaries? Yet you have to pay for that don't you? Is there anything else I can reference???
    Thanks for your review and am hopeful for a reply.
    PSULionRP

    Provider ID is well defined:
    "National Provider Identifier Standard (NPI)
    The National Provider Identifier (NPI) is a Health Insurance Portability and Accountability Act (HIPAA) Administrative Simplification Standard. The NPI is a unique identification number for covered health care providers. Covered health care providers and
    all health plans and health care clearinghouses must use the NPIs in the administrative and financial transactions adopted under HIPAA. The NPI is a 10-position, intelligence-free numeric identifier (10-digit number). This means that the numbers do not carry
    other information about healthcare providers, such as the state in which they live or their medical specialty. The NPI must be used in lieu of legacy provider identifiers in the HIPAA standards transactions."
    LINK:
    http://www.cms.gov/Regulations-and-Guidance/HIPAA-Administrative-Simplification/NationalProvIdentStand/index.html?redirect=/NationalProvIdentStand/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Installing  game....Not sure if this is the right place for this.....

    Could not find a better place.
    I would like to play World of Warcraft on a free server (already installed and playable) and on Retail. Is there a way I can do that without having to purchase an external HD. On my PC I have to have a different Drive. Any help would be appreciated. Thanks

    Well, it is a apple question though. It has to do with whether two of the same program can be housed on the same HD on a MAC. On a PC it can't, I am wanting to find out if it can on a MAC since they are different. Thanks for your response.

  • Not sure if this is the right place but......."noisy iMac, whats the deal?"

    Hey,
    I had recentely been having problems with my first gen iMac G5 (distorted video, noisy fans e.t.c), but after sending it in for repair ,courtesy of Apple Extention Repair Program, I am still having problems. I don't get the distorted video anymore but I am still getting the noise coming from my computer. Should this all have been taken care of when I put it in for repair or is the noise a seperate issue? Also, is there anyway I can fix this because it is driving me crazy?!?!?!
    Thanks
    Ian

    Since it was in for repair, I certainly would have mentioned it to the techs when I brought it in.
    There is no way for you to fix it, as the parts are no longer considered user serviceable.
    Since you just sent it in, I would call them and tell Apple that you are still having noise issues and see what they will do.

  • Not getting my messages in the right place.

    i can send a message on my iPhone 6 at work but the response turns up on my iPad at home. I don't know it is there until I get home.
    have had this happen a couple of times now. I don't get my answers on my phone, might be bad reception at work but have always gotten the messages before at work? Is it an iOS 8 thing?

    It doesn't work that way, unfortunately.
    If you could save as an OMF file in Pro Tools, it might open up properly in Logic.
    But the full proof way this is done, day in, and day out, when sharing audio files between platforms, is to export consolidated files that ALL start from bar 1, beat 1.
    Then it's a simple matter of importing the files into Logic, set the tempo the same, and then drop all audio files on bar 1, beat 1.

  • Not sure if this is the right place, but what video capture software....

    do you recommend? I need something that's cost efficient. I see that there is Mac Capture and Screen Record software that is available and both are under $30. Do any of you have experience with either one of these? Or are there any other that you guys recommend? I want to record the audio and video of the video files that I play on my Powerbook. Thanks.

    To me cost efficient is what works the best.
    SnapZPro from ambrosiasw.com

Maybe you are looking for