I have a command line app and I'd like for the working directory to be whatever location the user is executing the launcher from. Example:

If I execute the command "myLauncher" from the shell and my current directory is "/home/jls" then System.getProperty("user.dir") should return "/home/jls"

How can this be accomplished with BR? I don't mind specifying absolute paths to all my jars -- I just need to make sure the working directory is set to wherever the user is.

Best, JLS

asked 03 Aug '15, 17:56

rhyce's gravatar image

rhyce
1111
accept rate: 0%


You can use the following code: <workingdirectory>~/</workingdirectory>

link

answered 06 Aug '15, 11:53

jesus's gravatar image

jesus ♦♦
1.1k14
accept rate: 18%

Thanks for your answer, however I don't believe this is correct. I would like the working directory to be set for ANY working directory, not just the one I gave as an example.

For example, if my current directory is /tmp and I execute my launcher, I want the working directory to be /tmp. But the user changes directories to /opt/test, I want the working directory to be /opt/test.

(06 Aug '15, 11:56) rhyce

I understand the point but it cannot be currently done easily. Could you write us to support@bitrock.com so we can better track and investigate it?

(06 Aug '15, 13:28) jesus ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×155
×40

Asked: 03 Aug '15, 17:56

Seen: 1,463 times

Last updated: 06 Aug '15, 13:28