Fail to start JBoss5 - Common unexpected


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.

Labels

adsense (5) Algorithm (69) Algorithm Series (35) Android (7) ANT (6) bat (8) Big Data (7) Blogger (14) Bugs (6) Cache (5) Chrome (19) Code Example (29) Code Quality (7) Coding Skills (5) Database (7) Debug (16) Design (5) Dev Tips (63) Eclipse (32) Git (5) Google (33) Guava (7) How to (9) Http Client (8) IDE (7) Interview (88) J2EE (13) J2SE (49) Java (186) JavaScript (27) JSON (7) Learning code (9) Lesson Learned (6) Linux (26) Lucene-Solr (112) Mac (10) Maven (8) Network (9) Nutch2 (18) Performance (9) PowerShell (11) Problem Solving (11) Programmer Skills (6) regex (5) Scala (6) Security (9) Soft Skills (38) Spring (22) System Design (11) Testing (7) Text Mining (14) Tips (17) Tools (24) Troubleshooting (29) UIMA (9) Web Development (19) Windows (21) xml (5)