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

accept rate: 0%

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


answered 06 Aug '15, 11:53

jesus's gravatar image

jesus ♦♦
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



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



Asked: 03 Aug '15, 17:56

Seen: 1,463 times

Last updated: 06 Aug '15, 13:28