A: 

The simplest thing to do is not to set the JBOSS_HOME environment variable at all. If you call run.bat without the variable being set, then the script will set it to its own JBoss directory. Explicitly setting it allows you to override where JBoss looks for things, but then you have to manage it yourself, and you get into a mess.

So remove the variable, and let JBoss take care of its own directories.

skaffman
I cannot remove JBOSS_HOME.On production environment JBoss 4 used by other products.And they explicitly set JBOSS_HOME.But I need to use JBoss 5.I see that two different instances of JBoss works without problems. But I am not shure that my JBoss do not use jar files from installation of JBoss 4.
Vladimir Bezugliy
In that case, change the value of `JBOSS_HOME` before you run JBoss 5. You should be able to change it locally within the script that calls JBoss's `run.bat`
skaffman
Yes - I can to do it. But I want to know - should I to do it or changing of jboss.home.dir/jboss.home.dir properties will be enough?
Vladimir Bezugliy
@Vladimir: Changing `JBOSS_HOME` is easier - don't mess with the individual system properties unless you really need to
skaffman
I do not understand - why there are jboss.home.dir, jboss.home.url properties if we can just redefine JBOSS_HOME or start jboss from directory where JBoss was installed?
Vladimir Bezugliy
@Vladimir: Because some users want to change the position of the log dir etc, relative to `JBOSS_HOME`. You don't need to, so don't mess with those properties, just change `JBOSS_HOME`.
skaffman
If someone would like to change location of log directory or directory with configuration(default, web, etc) he should change swp.jboss.deploy.url and jboss.server.base.dir/jboss.server.base.url.It does not depend on JBOSS_HOME.
Vladimir Bezugliy
OK, I'm rapidly losing interest in this question... take it or leave it, chap.
skaffman