Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » command line compilation settings(Compile eclipse project from command line with ant)
command line compilation settings [message #672143] Fri, 20 May 2011 03:34 Go to next message
RyersonResearch  is currently offline RyersonResearch
Messages: 3
Registered: May 2011
Junior Member
Hi all:

I'm working on a static code analysis project at school which requires me to compile the sample project on the command line. The open source project I downloaded via SVN (jFire ERP) compiles ok in Eclipse. Then I did some searching and experimentation and found that I could also compile it from the command line using:

eclipse -nosplash -application org.eclipse.jdt.apt.core.aptBuild -data /home/jFire/jfireworkspace

However, the tool I'm using requires either javac or ant to be run, then wraps itself around one of these. I experimented with using javac but that didnt work out, and I also tried ant without anyluck. So I searched Eclipse preferences, config files, settings etc to see if there was somewhere I could capture the commands it send to javac and then use those on the command line, but didnt find any. I also copied the build.xml I found in Eclipse to a file in the workspace folder and then ran ant, but it just said compile successfully 0 seconds without doing anything. I reran it with debug on and got this (ant -v -k -d -diagnostics | less):

-------------------------------------------
Tasks availability
-------------------------------------------
image : Not Available (the implementation class is not present)
sshexec : Missing dependency com.jcraft.jsch.UserInfo
wlrun : Not Available (the implementation class is not present)
scp : Missing dependency com.jcraft.jsch.UserInfo
stlist : Not Available (the implementation class is not present)
netrexxc : Not Available (the implementation class is not present)
starteam : Not Available (the implementation class is not present)
stylebook : Not Available (the implementation class is not present)
stlabel : Not Available (the implementation class is not present)
jdepend : Missing dependency jdepend.xmlui.JDepend
stcheckin : Not Available (the implementation class is not present)
stcheckout : Not Available (the implementation class is not present)
ejbc : Not Available (the implementation class is not present)
wlstop : Not Available (the implementation class is not present)
ddcreator : Not Available (the implementation class is not present)
A task being missing/unavailable should only matter if you are trying to use it


Here is the build.xml from inside of Eclipse (I replaced ${target} with my dirs for ant to work):

<!-- call ant for all projects referenced by this project (from file .project) -->
<project default="build">

<target name="init">
<!-- set the dafault target dir (applies only if property is not already set) -->
<property name="target" value="${basedir}/target"/>
<xmlproperty file=".project"/>
</target>

<target name="clean">
<!-- delete the *local* target dir - not the ${target} dir -->
<delete dir="target"/>
</target>

<target name="build.subprojects" if="projectDescription.projects.project">
<subant>
<filelist dir=".." files="${projectDescription.projects.project}"/>
<property name="target" value="${target}"/>
</subant>
</target>

<target name="build" depends="init, build.subprojects"/>
</project>

Any ideas on how I can solve this?

Thanks in advance.
Re: command line compilation settings [message #672158 is a reply to message #672143] Fri, 20 May 2011 06:10 Go to previous messageGo to next message
Satyam Kandula is currently offline Satyam Kandula
Messages: 444
Registered: July 2009
Senior Member
You could specify to use the Eclipse compiler in the ant file. For detailed instructions, look at http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.jdt.doc.isv/guide/jdt_api_compile.htm under "Using the ant javac adapter".
Re: command line compilation settings [message #672409 is a reply to message #672158] Fri, 20 May 2011 23:20 Go to previous messageGo to next message
RyersonResearch  is currently offline RyersonResearch
Messages: 3
Registered: May 2011
Junior Member
Satyam Kandula wrote on Fri, 20 May 2011 02:10
You could specify to use the Eclipse compiler in the ant file. For detailed instructions, look at ....


Thanks Satyam:

I'm going to try that now.


Re: command line compilation settings [message #672438 is a reply to message #672409] Sat, 21 May 2011 02:37 Go to previous message
RyersonResearch  is currently offline RyersonResearch
Messages: 3
Registered: May 2011
Junior Member
Satyam:

It worked! The overall build failed though because it could not find some dependencies that are configured in eclipse. Going to try to figure out how to get this part working.

Thanks.
Previous Topic:Eclipse wont open
Next Topic:jetty 7 continuation help!
Goto Forum:
  


Current Time: Sat Sep 20 15:58:22 GMT 2014

Powered by FUDForum. Page generated in 0.01576 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software