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?
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.
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.
Related
I am trying to start the wso2server.bat for the WSO2 Application Server. This is available inside E:\wso2as-5.3.0\bin. But I am currently encountering this error when running the file from the windows command prompt.
My Environment Variables are as follows.
User Variable:
PATH: F:\ESB\wso2as-5.3.0\bin
System Variable:
JAVA_HOME: C:\Program Files (x86)\Java\jdk1.8.0_144
Path: F:\ESB\wso2as-5.3.0\bin
I've tried changing the Path Variables but I keep on getting this same error in starting the server.
Any suggestions in this regard will be much appreciated.
Right Click My Compuer -> Advanced -> Environment Variables -> System Variables -> Select Path variable -> append the below value.
Your user variable should look something like
F:\ESB\wso2as-5.3.0\bin;C:\WINDOWS\system32
Note: I am assuming you installed your windows in C drive.
my java installed in C:\Program Files\Java\jdk1.7.0_01\bin
Jboss server installed in D:\jboss-as-7.1.1.Final\bin
Already i have set the environment variables for your reference.
C:\Python27\;C:\Python27\Scripts;C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\;C:\Python27;C:\Python27\Scripts; C:\Program Files\Java\jdk1.7.0_01\bin
while i started to run the Jboss server7.1 via commands prompts getting error message "JAVA_HOME is not set".
Please provide me a solution
To overcome this message, set JAVA_HOME in standalone.conf.bat and domain.conf.bat file.
rem #
rem # Specify the location of the Java home directory (it is recommended that
rem # this always be set). If set, then "%JAVA_HOME%\bin\java" will be used as
rem # the Java VM executable; otherwise, "%JAVA%" will be used (see below).
rem #
set "JAVA_HOME=C:\Program Files\Java\jdk1.7.0_01\"
I'm using Mac 10.9.5 with JBoss 7.1.3.Final. I am launching JBoss through the termianl (bash shell), like so
Daves-MacBook-Pro:core davea$ cd $JBOSS_HOME/bin
Daves-MacBook-Pro:bin davea$ sudo sh standalone.sh
Within the shell, I can see that $JAVA_HOME is defined ...
Daves-MacBook-Pro:bin davea$ echo $JAVA_HOME
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
However, JBoss is not picking up this environment variable (it is using a Java 8 installation that I also have on my machine), forcing me to uncomment the following line in my $JBOSS_HOME/bin/standalone.conf file ...
JAVA_HOME="/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home"
Although this is straightforward, I would prefer a solution that is more automatic. Does anyone know what I have to do to get JBoss to recognize the $JAVA_HOME environment variable I have set in my shell without my having to hard-code the value in a Jboss config?
Edit:
(In response to the commnent posted) Keep in mind I’m doing all this from the same shell. So here is where I have shown I have the $JAVA_HOME environment var defined …
Daves-MacBook-Pro:bin davea$ echo $JAVA_HOME
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Then I edit my $JBOSS_HOME/standalone/bin/standalone.conf file in the way you suggest …
echo JAVA_HOME=$JAVA_HOME
echo "DONe with echo"
#JAVA_HOME="/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home"
and when I re-run the startup script, this is what prints out …
JAVA_HOME=
DONe with echo
If you really want to use sudo, you have to add the -E parameter to preserve the environment variables.
I try to run j boss 7.1 according to read me I go to j boss home and run standalone.bat
\bin\standalone.bat then command prompt gives a massage"calling \bin\standalone.conf.bat " that's all please help me to fix this .I' m using windows 7 , inside the oracle virtual box
By using \bin\standalone.bat you're telling Windows that, assuming you're drive name is C, to look for the command in C:\bin\standalone.bat. If you're in the directory of your JBoss install, generally referred to as JBOSS_HOME, add a . to the beginning of the command.
Example:
.\bin\standalone.bat
If you do have a JBOSS_HOME directory set you could do:
%JBOSS_HOME%\bin\standalone.bat
I'm having this weird situation :
My user's and system's PATH variable is different than the PATH in powershell.
When I do :
PS C:\$env:path
C:\Windows\System32\WindowsPowerShell\v1.0\;c:\oldpath
However this is not correct, it looks like it stuck on some old PATH variable of my system, so none of the udpates I've done on it didn't change this variable (I do restart after every change to test).
Why is this happening? Do I have to set a PATH variable just for powershell?
The change might be "delayed", so try one or more of these solutions:
Log off and on again;
Task Manager > Restart "Windows Explorer" (explorer.exe)
Restart your launcher app (launchy, SlickRun, etc)
Reboot
Explanation:
Powershell will inherit the environment of the process that launched it (which depends on how you launch it). This is usually the interactive shell (explorer.exe). When you modify the environment from computer properties, you modify the environment of explorer.exe, so if you launch powershell from explorer.exe, (for example from the start menu) you should see the new environment.
However, if you launch it from something else (say a cmd.exe shell that you already had opened), then you won't since that process was launched under the old environment.
In other words: be careful how you are launching things.
In my case, I installed an app that incorrectly added itself to the PATH by creating a powershell profile that would override $env:PATH and blow out the existing configuration every time I started powershell.
Check if you have profile at USER\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 and if it's doing anything fishy like setting $env:PATH.