Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Unhappy Questions about modifying bash_profile values, export, etc.

    My end goal: be able to use jar command from any directory i choose.

    I am trying to follow instructions for unzipping a war using the jar command,

    mkdir -p /tmp/my_ear
    cd /tmp/my_ear
    jar -xvf $WEBCENTER_HOME/archive/applications/webcenter.ear
    mkdir war
    cd war
    jar -xvf ../spaces.war

    I have been googling all day how to update the ~/.bash_profile using export $PATH...

    Can someone please help walk me through the correct steps to do this? I am not sure if the path should point to the JRE, the JDK or both, but more importantly I just am new to modifying the .bash_profile. I have made a couple of my own aliases for jumping to commonly used directories, but that is about it so far!

    From what I have found, it looks like this will be the path I use when updating the bash_profile - how can I confirm?
    And finally this is how it is currently setup in my ~/.bash_profile:

    export PATH
    export PATH=/u01/app/oracle/product/fmw/Oracle_WT1/instances/instance1/bin/:$PATH

    Last edited by sethbw; 04-20-2012 at 06:44 PM.

  2. #2
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Either at home or at work or down the pub
    As far as I can see, jar should be in /usr/bin which should already be in your path.

    You can view your current path by running the command
    echo $PATH
    which on my LMDE system produces
    You can see which version of a program is going to be run using the which command
    which jar
    on my system.

    If the which command doesn't find the program, you can try the following
    sudo updatedb
    locate jar
    The updatedb command can take a long time to run and needs to be run as root; if your disto doesn't use sudo then su to root first.

    If the locate command finds jar and if it installed then there is no reason it shouldn't, a more elegant solution may be to create a symlink in /usr/bin
    sudo ln -s /usr/bin/jar /path/to/jar
    Now to answer your question regarding your .bash_profile. I think the syntax is wrong. Try

    export PATH
    Should you be sitting wondering,
    Which Batman is the best,
    There's only one true answer my friend,
    It's Adam Bloody West!

    The Fifth Continent

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts