Question

I have JBoss 4 installed on my PC to directory C:\JBoss4
And environment variable JBOSS_HOME set to this directory:

JBOSS_HOME=C:\JBoss4  

I need to install JBoss 5.1 on the same PC.
I installed it into C:\JBoss51
In order to start JBoss 5.1 on the same host where JBoss 4 was already started, I need to redefine properties jboss.home.dir, jboss.home.url, jboss.service.binding.set:

C:\JBoss51\bin\run.sh -Djboss.home.dir=C:/JBoss51 \
                      -Djboss.home.url=file:/C:/JBoss51 \
                      -Djboss.service.binding.set=ports-01

But in C:\JBoss51\bin\run.sh I can see following code:

…
if [ "x$JBOSS_HOME" = "x" ]; then
    # get the full path (without any relative bits)
    JBOSS_HOME=`cd $DIRNAME/..; pwd`
fi
export JBOSS_HOME
…
runjar="$JBOSS_HOME/bin/run.jar"
JBOSS_BOOT_CLASSPATH="$runjar"

And this code does not depend either on jboss.home.dir or on jboss.home.dir.
So when I start JBoss 5.1 script will use jar files from JBoss 4.3?
Is it correct?
Should I redefine environment variable JAVA_HOME when I start JBoss 5.1?
In this case script will use correct jar files.
Or if I redefined properties jboss.home.dir, jboss.home.url then JBoss will not use any variables set in run.sh?

How does it works?

Was it helpful?

Solution

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.

OTHER TIPS

in my community 7 version i can edit the /bin/standalone.conf.bat and in your case set the variable like this:

set "JBOSS_HOME=C:\JBoss51"

right after this:

if not "x%JAVA_OPTS%" == "x" (
  echo "JAVA_OPTS already set in environment; overriding default settings with values: %JAVA_OPTS%"
  goto JAVA_OPTS_SET
)

This makes to load the JBOSS_HOME from the conf. and not from the environment variable, hope this can be helpfull!

Had this same problem with wildfly 8. I had another JBOSS instance using the JBOSS_HOME environment variable. I added the "set "JBOSS_HOME=.." as specified above and it worked.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top