File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes ant build problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply Bookmark "ant build problem" Watch "ant build problem" New topic
Author

ant build problem

marshal ma
Greenhorn

Joined: May 31, 2004
Posts: 23
Hi guys, please help me on this, I couldn't figure out:

I thought this may be unix problem, but I also put it here
in case anyone know it.

I have defined build.sh file like the following
-------------------------------------
JAVA_HOME="/bea/jdk141_05"
export JAVA_HOME

PATH="/home/mm/ant/bin:/bea/jdk141_05/bin"
export PATH

ant $1
--------------------------------------------

but when I ran build.sh(on unix/solaris), I got following error:
-----------------------------------------------
$ ./build.sh
/home/mm/ant/bin/ant: uname: not found
/home/mm/ant/bin/ant: basename: not found
/home/mm/ant/bin/ant: dirname: not found
/home/mm/ant/bin/ant: null directory
-----------------------------------------------

anyone know the reason?

thanks a lot for the help!!!
noel angel
Ranch Hand

Joined: Oct 27, 2002
Posts: 75
ANT requires xml syntax. The build file must be named build.xml or you need the option to rename the file when you call ant.
This is not the correct way to handle the environment. your snippet looks like a shell file not an ant build file???

Noel
Lewin Chan
Ranch Hand

Joined: Oct 10, 2001
Posts: 214


You might find changing it to


might be more useful...
the ant script itself cannot find any of the standard programs in /usr/bin, /usr/local/bin etc.

If all your build.sh is doing is wrapping the ant script, then it might be more logical to just add the required variables to your .profile or similar, rather than using another script

L


I have no java certifications. <br />This makes me a bad programmer.<br />Ignore my post.
marshal ma
Greenhorn

Joined: May 31, 2004
Posts: 23
Thanks noel angel and Lewin Chan !!! :-)

Noel, yeah, this is shell file, I didn't put build.xml here since I know it's right, I have used it to build successfully in Win env. Sorry I didn't express clearly here.

Lewin, you are right, "PATH=$PATH:/home/mm/ant/bin:$JAVA_HOME/bin" works!!
I also found if I export ANT_HOME, it also can build, but still showed
/home/mm/ant/bin/ant: uname: not found
/home/mm/ant/bin/ant: basename: not found
/home/mm/ant/bin/ant: dirname: not found
/home/mm/ant/bin/ant: null directory
before building. Using your code get these error disappear and I needn't export ant_home neither.

Thanks again for your guys help!!

Cheers!

m
 
 
subject: ant build problem
 
Threads others viewed
Installin Java on Linux
ant build problem
crontab
how to set PATH (setenv) in Terminal (Im trying to setup Ant)
FTP Issue