user.dir for Microsoft Java VM

Is there any way to set the default working directory (system property user.dir) for all Java applications run on a system (via a registry key, etc)? I know how to do it programmatically for one application, but I'd like to make the setting apply to all applications running on a workstation. Any help is appreciated.

Thanks!
James

[339 byte] By [staja2] at [2008-2-2]
# 1
Hi,
In windows "user.Dir" property returns the directory the command shell was in when the application was started. In other words it returns the current Directory only. As far as I know, there is no such setting in registry where you can change the current directory for all the applications.

If you can tell us the scenarios/issue where you need this setting, then we may suggest some other workaround.

Thanks.

JaiprakashSharma at 2007-9-9 > top of Msdn Tech,Visual J#,Visual J# General...
# 2
Hi Jaiprakash,

Thanks for taking the time to reply. I think you're right about how the "user.dir" is normally set. But from what I've read in the documentation, the current version of the Microsoft Java VM defaults "user.dir" to the users desktop regardless of where the app is launched from.

At my company our users' desktops reside on our fairly old and slow file and print server. When the server runs backups, our Java apps experience slowness. This is because the default classpath for the VM includes "." (user.dir). So essentially everytime a new class gets loaded, an unneccessary query to the file and print server is made, which can take up to 45 seconds. We want to make "." local if possible for the VM, so we are trying to find a way to change the default working directory to a directory on the user's workstation.

Option 2 is to remove the "." from the classpath, but it has a very slight potential of affecting other installed Java apps.

Thanks!
James

staja2 at 2007-9-9 > top of Msdn Tech,Visual J#,Visual J# General...
# 3
Hi James,
We need few more inputs here...

1. Are you working on visual J++ or Visual J#? If Visual J++ then which version?
2. Can you please send the link of the documentation or if you have it on your local machine then please paste that para here.

Actually i tried on Visual J++ also, but there too user.dir is set to current working directory only.

Thanks.

JaiprakashSharma at 2007-9-9 > top of Msdn Tech,Visual J#,Visual J# General...
# 4
Hi Jaiprakash,

1. Sorry I'm fairly new to the Microsoft VM, so I'm not sure if I'm answering this correctly. I'm not actually doing the development, I'm trying to support a 3rd party Java application. More specifically it is a web application using Java applets running in IE. Our version of JView is 5.00.3810.

2. I don't have any documentation on the product, but I'm not sure that matters since I'm more looking for a Microsoft Java VM setting. This file and print server dependancy is something that we discovered by using a network sniffer while they were experiencing the slowdowns.

I may have posted this to the wrong forum since I didn't actually do the development. I thought this was a forum related to the Microsoft Java VM specifically, but it looks like this may be a dev forum. If so I appologize.

Basically you can run a Java application with the command:

C:\> JView /d:user.dir=C:\Windows MyClassName

This sets user.dir to whatever you specify. I want a way to set the system property user.dir=C:\ globally for the entire JVM since for the app I'm supporting I can't change the command line options it uses when calling Java.

Thanks!
James

staja2 at 2007-9-9 > top of Msdn Tech,Visual J#,Visual J# General...