tags:

views:

14

answers:

1

I'm trying to get my web app to recognize my working directory. When running as a windows service, I can set

--StartPath=C:\Path\To\Directory\ 

and using that I can access files starting from that directory.

ie - Folder\Folder2\file.txt can be opened and recognized as being

C:\Path\To\Directory\Folder\Folder2\file.txt

I thought the same thing would work when not running as a service by just setting user.dir to C:\Path\To\Directory. But when I start the server it can't find the files.

Any advice?

A: 

I figured it out in a way that fits my needs. The only way to set the user.dir and have the java process recognize it, is to start a java process from the directory you want the user.dir to be. In my case I'm running Tomcat from MyEclipse, and it has an option for setting the working directory of Tomcat under launch configurations.

jpcamara