I changed my eclipse from kepler and ant 1.8.4 to neon and ant 1.9.6. If I run exactly the same project in Neon I got a ant build error by the following ant scp command:
<scp file="${jar.file}" todir="${user}#${host}:${destination.dir}/lib" keyfile="${privatekey}"
passphrase="${passphrase}" sftp="true" trust="true" />
BUILD FAILED C:\project\build.xml:31: com.jcraft.jsch.JSchException:
Could not send 'source.jar' to '/target/lib' - 3: Permission denied
The funny thing is, at the end the file is on the server.
In both eclipse I add the library jsch-0.1.53.jar to the ant classpath.
#StellaMaris look at this bug https://bz.apache.org/bugzilla/show_bug.cgi?id=59648
I'm using linux with Ant 1.8.4 and I have some target using scp, my colleagues running Windows, with Ant 1.9.5 have your problem and not only, it seems that Ant 1.9.5 has some regression in scp task.
Anyway the solution is using ANT 1.9.4, jsch 0.1.42 is good although here states that minimum requirement is jsch 0.1.50
Related
I am working as an eclipse plugin developer and when I try to build my eclipse sources from command line using ant, it fails with following error.
java.lang.NoClassDefFoundError: org/eclipse/jdt/internal/compiler/impl/CompilerOptions
I am using java 1.7_72, eclipse 44, ant 1.7.1
It was working with this configuration for long time on my machine, and it suddenly started failing with this message. I have tried various options like uninstalling and reinstalling all the possible software that could affect, gone for fresh copy of eclipse, ant and much more.
It works on my colleagues machine and we all use the same software eclipse/ant/java etc.
Any inputs are welcome.
Thanks a lot in advance.
I have been struggling with similar error using Eclipse's PDE headless product build scripts.
The error occurs when the builder executes a temporary build.xml file that it generated for my plugin. this build file compiles my plugin code.
trying to run this temporary build file manually with ant on the command line works though.
Obviously, the error suggests an issue with the JDT compiler.
Looking at the generated build.xml, I found out the following target:
<target name="properties" if="eclipse.running">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
</target>
which tells the builder to override the default JDK compiler when the property eclipse.running is true.
I added
<property name="eclipse.running" value="false"/>
at the beginning of my build script: the error disappeared and my build completed successfully
In my case, the issue also appeared during PDE headless build with Eclipse Neon. The build script property (baseLocation) was pointing to a running instance of Eclipse.
Closing Eclipse before running the build resolved the issue.
The issue appeared after an update of the Target Platform. It ended up to include a newer version of Eclipse and JDT in addition to installed version.
It showed up again after update from Eclipse Neon to 2019-03 (4.14). Adding the -data <workspace>" to the eclipse launcher command-line solved it.
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.
I have been receiving the following error and have done a lot of research and tried all of the offered solutions to no avail.
junitreport:
[junitreport] Processing C:\workspace\test123\junit\TESTS-TestSuites.xml to C:\Users\Matt\AppData\Local\Temp\null1903337257
[junitreport] Loading stylesheet jar:file:/C:/Users/Matt/Documents/Selenium/eclipse/plugins/org.apache.ant_1.8.3.v20120321-1730/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] : Error! The first argument to the non-static Java function 'replace' is not a valid object reference.
[junitreport] : Error! Cannot convert data-type 'void' to 'reference'.
[junitreport] : Fatal Error! Could not compile stylesheet
[junitreport] Failed to process C:\workspace\test123\junit\TESTS-TestSuites.xml
BUILD FAILED
C:\Users\Matt\workspace\Test1\build.xml:122: Errors while applying transformations: Fatal error during transformation
I found a solution at ant junit build error inside eclipse and saying that the issue was caused by a newer version of JDK and using 1.6_31 would solve it and I tried that following instructions I found online on how to change the version of Java eclipse is using. Every time I run the build ant it returns the same error regardless of which version of Java I am using. I have tried JRE7, jdk1.7.0_05, jdk1.6.0, jdk1.6.0_31 and others that I don't have installed anymore.
I am running the following
Windows 7 Pro SP1 x64
Eclipse IDE for Java Developers Version: Juno Release Build id: 20120614-1722
org.apache.ant_1.8.3.v20120321-1730
If anyone could provide any assistance in getting this report running it would be greatly appreciated. I'm new to programming and this is very frustrating especially since I'm still learning all of the jargon and trying to be sure I am following the instructions properly. If you require anymore information from me I will provide it and I will follow any instruction given to the best of my ability. Thank you very much in advance.
While an Ant Bug Report 384757 claims that this is caused by the XSL Tranformer build into the Oracle JDK - which may be true - the problem can be fixed by changing the Ant version:
I tried some of the workarounds mentioned there. After a while, I found that the bug appears with Ant 1.8.3 (distributed in Eclipse), but not with Ant 1.8.2 (distributed in Eclipse 3.7).
The bug also does not appear with Ant 1.9.0.
I have downloaded Ant 1.9.0 and in configured Eclipse's "Run As -> Ant build..." to use the Ant 1.9.0 folder as ANT HOME. This worked.
PS: My Eclipse used Ant 1.8.3 (which did not work), but running Ant from the console used Ant 1.8.2 (which worked). This was confusing at first.
I have solved the issue by downloading apache-ant-1.9.1 and configuring it in Eclipse by changing the ANT HOME from windows--> Preferences and setting the ANT HOME to apache-ant-1.9.1.
Below workaround fixed the build issue I had...
Download the 2 jar files from the urls given below and add those to Ant-Runtime Classpath located on Eclipse at:
Window>Preferences> Ant>Runtime>Ant Home Entries
http://www.java2s.com/Code/Jar/x/Downloadxalanjar.htm
http://www.java2s.com/Code/Jar/a/Downloadapachexmlxercesjar.htm
Restart eclipse and run the Ant build.
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.
I installed eclipse Helios a week ago. First I installed it without the CDT.
Today I installed the CDT along with the autotool (this it what can be seen in the list of possible updates). Afterwards, I installed also the minGW (Wascana) as written in the manual of CDT.
but after I create an Hello World project in eclipse I get this error (blinking non stopable) in the console tab:
Invoking autoreconf in build directory: D:/eclipse/proj/workspace/testcpp
Configuration failed with error
(Cannot run program "autoreconf": Launching failed)
Can anyone help me with this? What else do I need to install or config so my CDT will work?
thanks,
Eli
The autotools plug-in doesn't work on Windows yet. There is a fix in place for the upcoming Indigo Eclipse release.
The main problem is that Windows doesn't know how to run shell scripts (which is what autoreconf is). You have to launch the shell manually and ask it to run it. And that's what the fix is.