0

My problem is that my simple build script who will just print a message is not working in Eclipse Indigo Service Release 2. The Script is given below-

<target name="greetings">
<echo>
         Eclipse!
</echo>       
</target>

When I tried to execute this script, it is not giving me any error but not printing the message 'Eclipse!'. Also it is not terminating the script, it is continuously in running mode, I have to manully stop it. My project is pointing to 'JDK1.6.0_32' not JRE. All the necessary jars like 'tools.jar' is there. Please let me know why it is happening.


Hi, Thanks everybody for the reply. Yes it is there , the full script is-

<?xml version="1.0" encoding="UTF-8"?>
<project name="Test" default="greetings" basedir="."> 
<target name="greetings"> 
<echo> Eclipse! </echo> 
</target> 
</project> 

But still the same problem. It is not showing anything. May be problem is somewhere else in configuration. Please let me know.

4 Answers4

0
  • an ANT script should contain the root element <project/>.
  • <project/> contains an attribute called default which points to the default target to be executed.
  • It is not mandatory to have default attribute. But it is mandatory to have at least one target. your script should look like this.

    <project default="greetings">
    <target name="greetings">
    <echo>
    Eclipse!
    </echo>       
    </target>
    </project>
    
Shurmajee
  • 1,027
  • 3
  • 12
  • 35
0

I am using Version: Indigo Service Release 2 Build id: 20120216-1857

<?xml version="1.0" encoding="UTF-8"?>
<project name="asdc" default="greetings" basedir=".">
    <target name="greetings">
     <echo>
     Eclipse!
     </echo>       
    </target>
</project>

It is running good.

Govil
  • 2,034
  • 20
  • 20
0

I had exactly the same problem, no error output and not running.

What I did was playing a little with the JRE configuration in "External Tools Configuration...", there are three options "Run in the same JRE as the workspace", "Execution environment" and "Separate JRE".

Changing it from "Execution environment" to "Run in the same JRE as the workspace" solved the problem.

carrizo
  • 65
  • 6
0

What's your Eclipse version and your OS ? Do you use the ant version eclipse ships with or did you edit the Ant_HOME settings via
Window | Preferences | Ant | Runtime | Ant Home Entries ?

a simple script like that should work out of the box :

<project>
 <echo>Howdie :-)</echo>
</project>

Please check your workspace/.metadata/.log file for errormessages.

Rebse
  • 10,307
  • 2
  • 38
  • 66