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

A

Ahmed Moustafa

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,
 
I

Ike

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top