Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have installed ant on my ubuntu 12.10. When i try to compile a java project with build.xml, i get the following error:

/usr/bin/ant: 1: eval: Syntax error: Unterminated quoted string


ls -lrt /usr/bin/ant
lrwxrwxrwx 1 root root 20 May 18  2012 /usr/bin/ant -> ../share/ant/bin/ant

if i use \ant is works.

dpkg -l ant
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                       Version            Architecture       Description
+++-==========================-==================-==================-=========================================================
ii  ant                        1.8.2-4build2      all                Java based build tool like make

Please help

share|improve this question
1  
How did you install ant? Using the Ubuntu package I suppose? Please show the output of dpkg -l ant run from a terminal in your question. To me this looks like an issue with ant itself, not the build file itself, because the error message shows line 1 of /usr/bin/ant to be the fault. –  gertvdijk Jun 23 '13 at 10:57
    
If ant is installed properly(and at first glance, it looks like it has), this would be a problem with your code, specifically. You can certainly post your code here for us to look at, but this question might be better suited for StackOverflow –  Kevin Bowen Jun 23 '13 at 10:57
    
dpkg -l ant Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-==========================-==================-==================-===========‌​============================================== ii ant 1.8.2-4build2 all Java based build tool like make –  Vivek Jun 23 '13 at 12:36
    
@Vivek Please edit your question to provide more details. It's how this site works (comments are not fit for that as you see!). I suspect now that you've set up an alias in your shell. Could you try invoking ant with a backslash prepended, e.g. \ant build.xml? That would disable any aliases configured. Also, what is the output of ls -l /usr/bin/ant? This should be a symbolic link to ../share/ant/bin/ant. If not, you've changed something on your system and you need to tell us what you did. –  gertvdijk Jun 23 '13 at 13:23
    
@gertvdijk- \ant is working :-) –  Vivek Jun 23 '13 at 14:38
show 1 more comment

1 Answer

As appeared in the comments, there's a Bash alias set for ant which overrides the call to the regular ant in PATH, because running ant with a backslash prepended (\ant) does work.

This alias setting not happen automatically - you have set this yourself somehow.

Run

alias

to see what aliases you have defined more on your system. Locate the line in any of the scripts initializing your shell to disable this. Files like

  • ~/.profile
  • ~/.bashrc
  • /etc/envrionment

are the ones to check. Use for example

grep -n ant ~/.profile ~/.bashrc /etc/environment

to locate the file and line number. Remove the line, then log out and log back in.

share|improve this answer
    
I checked all the files but could not find any wrong alias to ant. Any other hint to track this? –  Vivek Jun 23 '13 at 15:56
    
@Vivek This is a needle in a haystack. Can you create a (temporary) other user and while logged in as the other user try it again? Report back if that works or not - if so, then that would limit the scope to user files. –  gertvdijk Jun 23 '13 at 15:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.