Unable to start JBoss 5 - \Common was unexpected at this time
--Don't use quotes in path variable
Today, I download JBoss 5 in my Windows 7 - 64 bit machine, and try to use run.bat to start the server, but it fails, and reports error:
\Common was unexpected at this time.
Google searched, but found nothing useful.
So I tried to take a look at the run.bat, first I comment the first row "@echo off", so I will now where it stops with the error above. I located the source of the errors:
if not "x%JBOSS_NATIVE_HOME%" == "x" (
set "PATH=%JBOSS_NATIVE_HOME%;%PATH%;%JBOSS_HOME%\bin"
set JAVA_OPTS=%JAVA_OPTS% "-Djava.library.path=%JBOSS_NATIVE_HOME%;%PATH%;%JBOSS_HOME%\bin"
)
Then I check the PATH environment:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;"C:\Program Files (x86)\Common Files\EMC";C:\Program Files\Perforce;%JAVA_HOME%\bin;%ANT_HOME%\bin;%MVN_HOME%\bin
Yeah, find out the culprit: the quotes around the path to EMC common files - "C:\Program Files (x86)\Common Files\EMC"
After removed the quotes, start a new command line, JBoss can be started with no problem.
Lesson learned: don't put quotes in your environment variables, such as PATH, JAVA_HOME etc, this may make scripts broken. This also applies when installation program update these variables.