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

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.

Related

Where maven is installed (eclipse plugin)

I have M2Eclipse plugin installed on my eclipse, and now I am reading a book that says to use the mvn command, I think that I could use eclipse IDE to follow the book, but I want to know a little more about maven. Of course, the command "mvn" is not recognized, I need to edit my PATH variable.
I googled where is maven installed, and the answer is that it is an apache tool and the path is where you want to unzip the package.
BUT, what if I don´t want to install the apache project?? Is there any other option, because how I say at the beginning, I have M2Eclipse plugin installed, so I image that the executable file must to be in some folder into the plugin eclipse path... or does it use only java jar libraries without a binary??
Thank you very much.
M2E is a plugin in Eclipse and not Maven. You are using an embedded Maven version which is part of Ecilpse. You should always install Maven to be useable via command line cause there are difference between M2E/Eclipse and command line.
You can run any mvn goal by clicking on a maven project, than right click and select Run As -> Maven Build... and type any goal you want.

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à!

Does Eclipse ship ant with its own distribution?

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.

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