File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Issues Re Environment and Path Variables In Windows XP For JBoss and ANT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Issues Re Environment and Path Variables In Windows XP For JBoss and ANT" Watch "Issues Re Environment and Path Variables In Windows XP For JBoss and ANT" New topic
Author

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

Bruce Berry
Greenhorn

Joined: Dec 01, 2008
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

Joined: Oct 27, 2005
Posts: 19543
    
  16

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Bruce Berry
Greenhorn

Joined: Dec 01, 2008
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

Joined: Oct 13, 2005
Posts: 36486
    
  16
Sounds a question more difficult than we usually get on beginners'. Moving.
Bruce Berry
Greenhorn

Joined: Dec 01, 2008
Posts: 9
Anyone have any thoughts..I'm completely stalled

Thanks
B
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

What happens when you echo this PATH on the command line?


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Issues Re Environment and Path Variables In Windows XP For JBoss and ANT
 
Similar Threads
unable to run ant after unzipping binary distrbtn
Prob with ANT_HOME or PATH
'ant' not recognized...
Eclipse's ANT using CVS gets error code 1
problem in defineing ANT_HOME