Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!

# Issues Re Environment and Path Variables In Windows XP For JBoss and ANT

Bruce Berry
Greenhorn
Posts: 9
All,

I am attempting to set up JBoss 4.0.2, ANT 1.6.5 and Xdoclet 1.2.3 on Windows XP to begin working through the examples in the O'Reily JBoss at Work book. I'm having issues running ANT and starting JBoss at a Windows cmd prompt from anywhere other than their respective install directories

I have installed all of the above software successfully and can get JBoss to start by invoking run.bat in the jboss-4.0.2\bin directory. My user environment variables for Java, ANT and JBoss are as follows:

ANT_HOME C:\Program Files\apache-ant-1.6.5

JBOSS_HOME C:\Program Files\jboss-4.0.2

JAVA_HOME C:\Program Files\Java\j2sdk1.4.2_19

The "end" of my Path system environment variable is as follows:

%JAVA_HOME%\bin;%ANT_HOME%\bin;%XDOCLET_HOME%;%JBOSS_HOME%\bin

When I try and do "ant -version" or "run" at a cmd prompt (anywhere other than the install directories for ANT and JBoss) I get a "is not recognized as a internal or external etc" error. I can do java -version from any directory and that works fine. I have echoed all of the variable values and they seem right, instal directories match with the user variables. I have restarted XP serveral times

Is my path statement correct??

Rgrds and thanks
BB

Rob Spoor
Sheriff
Posts: 20529
54
Try enclosing each of the path parts in quotes:
"%JAVA_HOME%\bin";"%ANT_HOME%\bin";"%XDOCLET_HOME%";"%JBOSS_HOME%\bin"

Because most (or even all) have a space in the path, the path variable stops at the first space - not the end of what you specified it to be*. By enclosing each of these in quotes you solve this issue.

You'll probably have to do the same for all other paths in your path variable.

* Actually, some programs can deal with this, but especially Ant seems to have problems with it.

Bruce Berry
Greenhorn
Posts: 9
Rob,

Thanks for your response. I added quotoes to the elenents of my path as you suggested, but I still can't run the ant or jboss batch files anywhere but from their instal directories. I'm stumped.

Thanks
BB

Campbell Ritchie
Sheriff
Posts: 48957
60
Sounds a question more difficult than we usually get on beginners'. Moving.

Bruce Berry
Greenhorn
Posts: 9
Anyone have any thoughts..I'm completely stalled

Thanks
B

Martijn Verburg
author
Bartender
Posts: 3275
5
What happens when you echo this PATH on the command line?