Results 1 to 13 of 13
  1. #1
    BobS0327 is offline Member
    Join Date
    Oct 2014
    Posts
    5
    Rep Power
    0

    Default Ant generates error.

    I am using Ant version 1.94 on a Windows 7 machine. Every time I run Ant, I get the following command line error..

    The syntax of the command is incorrect.
    This problem only starting happening about a month ago. Prior to that I had absolutely no problem running Ant.

    Any suggestions to fix this problem would be greatly appreciated.

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: Ant generates error.

    I know very little about Ant. However, I doubt an expert could help since you haven't included the Ant command that is
    generating the error. Is the Ant script that is causing the problem? A CLI issue? You should probably include that statement
    and several before and after for anyone to help you.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    BobS0327 is offline Member
    Join Date
    Oct 2014
    Posts
    5
    Rep Power
    0

    Default Re: Ant generates error.

    I've executed Ant from the command line by simply typing Ant and hitting the enter key. When Ant was working, it would find the default build.xml file which would be in the same directory from which I executed the Ant command and build the project.

    Also, the following command generates the above mentioned error

    Ant -version
    My system CLASSPATH variable is C:\Program Files (x86)\Java\jre7\lib\ext
    Last edited by BobS0327; 10-19-2014 at 02:50 AM.

  4. #4
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: Ant generates error.

    It could be an installation problem. The execution path could be messed up. Or an environment variable may be pointing to
    an older version but somehow using newer stuff. I just don't know. You can either try to re-install it or wait until someone
    else who knows more comes online. You could also go to the Ant web site and see if there are any installation tips or problem
    areas.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  5. #5
    BobS0327 is offline Member
    Join Date
    Oct 2014
    Posts
    5
    Rep Power
    0

    Default Re: Ant generates error.

    I tried uninstalling and reinstalling Apache Ant version 1.94. Unfortunately, that didn't resolve the problem.

  6. #6
    StormyWaters is offline Senior Member
    Join Date
    Feb 2009
    Posts
    312
    Rep Power
    11

    Default Re: Ant generates error.

    Not familar with Ant, but this sounds like a problem with the Windows PATH environmental variable. Try going into the Ant directory and running the command there? Does it work? If so, just add that directory to the Windows PATH environmental variable.

  7. #7
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: Ant generates error.

    I would agree, but the quoted error is not the standard "unrecognized command" error that Windows throws up which you would get with a PATH problem.

    My system CLASSPATH variable is C:\Program Files (x86)\Java\jre7\lib\ext
    That is very wrong, but I wouldn't see how this would cause this vague error either.
    Last edited by gimbal2; 10-30-2014 at 08:06 PM.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  8. #8
    BobS0327 is offline Member
    Join Date
    Oct 2014
    Posts
    5
    Rep Power
    0

    Default Re: Ant generates error.

    Try going into the Ant directory and running the command there? Does it work?
    I went directly into the bin folder where Ant is located and executed it. I still got the same message.



    Also, after reinstalling Ant, I changed the ANT_HOME environment variable to C:\utils\APACHE~1.4. I thought using the 8.3 naming convention might resolve the problem. Unfortunately, it didn't.

  9. #9
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: Ant generates error.

    So what happens when you type 'java -version' on the commandline?
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  10. #10
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: Ant generates error.

    I just searched the web and someone else had that problem a few years ago. Here was how they fixed it.

    'Actually the problem is solved..This was happening because my CLASSPATH system variable was ending with "." '

    So it may still be related to the CLASSPATH.

    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  11. #11
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: Ant generates error.

    Hence my request, I have that nagging feeling that Java itself won't even work and that ANT being in the way is just a red herring.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  12. #12
    BobS0327 is offline Member
    Join Date
    Oct 2014
    Posts
    5
    Rep Power
    0

    Default Re: Ant generates error.

    So what happens when you type 'java -version' on the commandline?
    I get the following message:
    java version "1.7.0_09"
    Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
    Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)
    Also, I have no problem using javac from the command line.

    I just searched the web and someone else had that problem a few years ago. Here was how they fixed it.

    'Actually the problem is solved..This was happening because my CLASSPATH system variable was ending with "." '

    So it may still be related to the CLASSPATH.
    I initially didn't have a CLASSPATH environment variable defined but decided to define CLASSPATH as c:\temp. I still get the same error message with or without a CLASSPATH variable.

    I'm thinking that there might be an issue with the Ant.bat file. Unfortunately, most of the file does not make much sense to me.

  13. #13
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: Ant generates error.

    I just downloaded and installed Ant 1.9.4. From the bin directory I had no problems getting it to run except it couldn't find the tools.jar file for Java 8. That was a simple fix. My CLASSPATH is not set. I have done no further testing.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Similar Threads

  1. How do I create a code that generates random text?
    By Maya Berkowitz in forum New To Java
    Replies: 7
    Last Post: 02-08-2012, 11:01 AM
  2. My program generates new errors
    By BenH in forum New To Java
    Replies: 8
    Last Post: 01-31-2012, 06:21 AM
  3. A servlet that generates html pages
    By soichi in forum New To Java
    Replies: 2
    Last Post: 01-20-2011, 07:21 AM
  4. Loading resources generates warning messages
    By Namita Patil in forum New To Java
    Replies: 6
    Last Post: 07-03-2008, 02:04 PM
  5. Generates random maths questions
    By cachi in forum New To Java
    Replies: 4
    Last Post: 08-01-2007, 04:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •