How to get the current working directory in a Java Web Start application

Discussion in 'Java' started by Ahmed Moustafa, Sep 19, 2003.

  1. In a Java Web Start application,
    <code>System.getProperty("user.dir")</code> throws an access denied
    exception, how can the current working directory be retrieved?

    Thanks in advance,
     
    Ahmed Moustafa, Sep 19, 2003
    #1
    1. Advertising

  2. Ahmed Moustafa

    Ike Guest

    This is JUST an idea Ahmed, which I have been toying with, but am stuck
    on....
    In Windows, if I create a batch file, called getcwd.bat, which contains the
    sole line of text, as follows:

    print %0 >getcwd.prn

    And I double click on it from the file manager
    it will output a string to getcwd.prn, which contains a full string to the
    path that it is in. Thus, if I do this, from within the path where my
    executable class is in, I can read and parse getcwd.prn to determine where I
    am.

    However, I can make it work manually, but not from within a java
    applicaiton. If you CAN...would you kindly, KINDLY pass it on to me and the
    group. Thanks, Ike

    "Ahmed Moustafa" <> wrote in message
    news:5Awab.9104$...
    > In a Java Web Start application,
    > <code>System.getProperty("user.dir")</code> throws an access denied
    > exception, how can the current working directory be retrieved?
    >
    > Thanks in advance,
    >
     
    Ike, Sep 20, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Willi Sanders
    Replies:
    0
    Views:
    630
    Willi Sanders
    Nov 25, 2003
  2. Matt
    Replies:
    1
    Views:
    27,441
    Sudsy
    Jun 6, 2004
  3. albert kao
    Replies:
    3
    Views:
    2,059
    Arne Vajhøj
    Feb 2, 2011
  4. Bob Walton
    Replies:
    9
    Views:
    205
    David K. Wall
    Sep 26, 2003
  5. Replies:
    3
    Views:
    408
Loading...

Share This Page