Does Eclipse ship ant with its own distribution? - eclipse

First time using Apache Ant (I'm excited and overwhelmed at the same time!) for automating a Java app.
I did not go to the ant website and download ant directly. Rather, I'm using the standard plugin that ships with Eclipse. From Eclipse, I can run test build.xml projects perfectly. But when I go to run ant directly off the command-line, Windows doesn't recognize it as a recognized command.
This leads me to believe that I either do not have ant installed, or I have not configured it properly (at all). If it's not installed, then why do these build.xml scripts work when I fire them inside of Eclipse? Does Eclipse ship with its own distrib of ant that isn't accessible from the cmd line?
And if it's just a config issue, what do I need to do in order to get ant to run a buildscript of my own flavor?
I want to start using Apache Ivy and in order to run the demos I first need ant up and running from the command line.
Thanks for any help or insight :-)

Does Eclipse ship with its own distrib of ant that isn't accessible from the cmd line?
Essentially, yes. Eclipse bundles the core Ant runtime plus its own extensions and integration, but it's private to the Eclipse installation.
If you want to run the builds from outside of Eclipse, you need to download and install the full distribution of Ant.

Related

Task cannot continue because ECJ is not installed -- in Eclipse ant

I have some ant task which says on first run
Task cannot continue because ECJ is not installed.
ECJ was automatically installed. Please rerun your task.
When running with standalone Ant, it runs ok second time. I don't know what is ECJ, but apparently it is installing in standalone Ant.
Contrary when running with Eclipse Ant this message persisting, i.e. ECJ is not installing into Eclipse' Ant.
How to fix the situation?
This page helped me:
In Eclipse, Go To Window->Preferences->Ant->Runtime
Select "Ant Home Entries (Default)"
Add External JAR... ecj.jar. Available in the lib folder of the Liferay Plugins SDK.
Ant should now be able to compile from your build.xml
I was facing similar issue In Windows.I did below thing.
There is one jar file(ecj.jar) inside ${ant.home}/lib folder.That file was not rechable. Setting environment variable ANT_HOME_PATH to apache ant.solved my issue.
Note: Point that variable to ant home and not to bin directory.

How do I run an eclipse project without eclipse?

I want to send my project I made in eclipse to others, so I tried running the project in my workspace. But I don't have a software to run it.(besides eclipse) What software should I use?
I don't have a software to run it.(besides eclipse) What software should I use?
You should use Java. Eclipse is just an IDE, so it doesn't run your Java programs. Java does. Export your program as a JAR, and if you have Java installed, you can run the JAR by double-clicking on it, or by running it from the command line:
java -jar file.jar
First Step
Second Step
Third step
voilĂ !

Run sequel of run configurations in Eclipse

I work on web applications with eclipse which means each time I modify server side code I have to run maven clean install then start my server again. I have run configurations for these both steps in eclipse but need to wait for the first one to finish before starting the second one.
I have also other cases when I need to run maven clean install on 5 or 6 projects in a given order after having updated all of them.
So my question is: does anybody know how to define sequels of runs and run them in the right order on one click in Eclipse (i'm using Indigo). I didn't found any plugin nor help on my favorite search engine.
You can write an Ant-script which wraps the Maven commands (with using Maven Ant Tasks) in the correct order. Then you can create a launch configuration for that Ant script in Eclipse.
Or just write a shell script and create an launch configuration for that in Eclipse.

Where is mvn.exe when using embedded maven 3 in eclipse indigo?

I'm using the Indigo Release of eclipse. When I check Window -> Preferences, Maven -> Installations, it confirms that it's using the Embedded (3.0.2/...) installation of Maven.
I want to be able to run maven commands from the command line (Windows Powershell), but when I type, e.g.,
PS C:\> mvn
no executable is found. I did a search for "mvn.exe" and found no results.
I suppose I could install a stand-alone version of Maven 3 and add that to my PATH, but I'd prefer to be using the same Maven installation for command line tasks as well as IDE (eclipse) tasks.
So, where is the embedded maven's mvn.exe hiding?
The simple answer is, cause it's embedded in Eclipse so you can't call it from console. If you like to do this you have to install Maven yourself.
There is no mvn.exe at all. The Maven distro comes with batch or shell scripts. Eclipse runs an embedded version which is called through an API.
remember, embedded maven is not configured to work out of eclipse environment (and terminal usage is out of STS usage).
we have to install maven.
and also note, there is no "mvn.exe"
follow the following to setup maven to work from terminal.
maven download link is here
download latest maven from here
extract it where ever you want.
i extracted as below (see the bin,boot,conf,... folders are shown below as in the image):
as this maven download is extracted from zip file (it is not setup), you will have to add this extracted path to "PATH" variable in windows environment.
follow this to set environment path:
now "mvn" command must work.
in my case, i use STS (spring tool suite)
and i had to restart STS for "mvn" to work in terminal in sts.
check it out with eclipse.

Can eclipse be used to fully replace ant?

I don't want to build the files manually with command line,
is it possible for eclipse to do the equivalent for tomcat automatically?
eclipse by default does compile your project automatically. Do you mean to have eclipse deploying to tomcat automatically?
If that is what you would like to do, Eclipse WebTools has support for deploying to servlet container. One example of how to do that is http://www.ibm.com/developerworks/opensource/library/os-eclipse-tomcat/index.html
If you have a build.xml file in your project root, you can right click on it in eclipse, select Run As -> Ant Build...
From there you can configure how it should run the script just as if you were using ant.
Question title
Can eclipse be used to fully replace ant?
Short answer: Do not compare apples with oranges.
Eclipse IDE (Building is one of its feature). Wiki
Ant Build tool. Wiki
Tomcat Webserver. Wiki