<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>zer(o_0)ne &#187; javac-task</title>
	<atom:link href="http://www.zero0ne.de/tag/javac-task/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zero0ne.de</link>
	<description>Datenreisender, Cyberpunk, Sysadmin, Console Cowboy ... lebt in der Wired</description>
	<lastBuildDate>Wed, 08 Feb 2012 14:49:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Ant + ECJ</title>
		<link>http://www.zero0ne.de/2009/02/ant-ecj/</link>
		<comments>http://www.zero0ne.de/2009/02/ant-ecj/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 22:16:21 +0000</pubDate>
		<dc:creator>zer(o_0)ne</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[ant task]]></category>
		<category><![CDATA[build.xml]]></category>
		<category><![CDATA[Classpath]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[ecj]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[eclipse.jdt]]></category>
		<category><![CDATA[eclipse.jdt.core]]></category>
		<category><![CDATA[failonerror]]></category>
		<category><![CDATA[javac]]></category>
		<category><![CDATA[javac-task]]></category>
		<category><![CDATA[jdt]]></category>
		<category><![CDATA[JDTCompilerAdapter]]></category>
		<category><![CDATA[Kompiler]]></category>
		<category><![CDATA[kompilieren]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[proceedOnError]]></category>
		<category><![CDATA[task]]></category>

		<guid isPermaLink="false">http://www.zero0ne.de/?p=381</guid>
		<description><![CDATA[Wenn man in Bezug auf ant mal nicht javac als Compiler nehmen will sondern ECJ, dann braucht man nicht viel zu tun. Als erste schnappt man sich das &#8220;org.eclipse.jdt.core_3.4.2.v_883_R34x.jar&#8221; aus einer Eclipseversion. Hier zum Beispiel aus Eclipse 3.4.1.. Das kopiert man dann in das &#8220;lib&#8221;-Verzeichnis von ant. Bei mir liegt dies unter &#8220;/usr/share/ant/lib&#8221;. Wenn man [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Wenn man in Bezug auf ant mal nicht javac als Compiler nehmen will sondern ECJ, dann braucht man nicht viel zu tun. Als erste schnappt man sich das &#8220;org.eclipse.jdt.core_3.4.2.v_883_R34x.jar&#8221; aus einer Eclipseversion. Hier zum Beispiel aus Eclipse 3.4.1.. Das kopiert man dann in das &#8220;lib&#8221;-Verzeichnis von ant. Bei mir liegt dies unter &#8220;/usr/share/ant/lib&#8221;. Wenn man da keine Schreibrechte hat, kann man das JAR auch nach &#8220;~/.ant/lib&#8221; kopieren. Dort findet es ant dann auch. <span id="more-381"></span>So die Theorie, leider klappe das nicht ganz so einfach auf meinen Fedora 9 System. Ich musste noch aus dem oben genannten JAR das darin enthaltende &#8220;jdtCompilerAdapter.jar&#8221; entpacken und auch in das lib-Verzeichnis von ant. Danach ging alles. Und dieses alles ist folgendes: in seiner &#8220;build.xml&#8221; muss man jetzt nur noch ein spezielles &#8220;property&#8221; setzen.</p>
<p><code>&lt;property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter" /&gt;</code></p>
<p style="text-align: justify;">Und damit wären wir auch schon fertig! Jetzt wird beim kompilieren mit dem &#8220;javac task&#8221; immer ECJ genommen anstatt der Compiler des System-JDK.</p>
<p style="text-align: justify;">Und wenn man mal &#8220;fehlerhafte&#8221; Klassen kompilieren will, kann man jetzt das &#8220;javac Flag&#8221; &#8220;failonerror&#8221; auf &#8220;off&#8221; setzten. Anders als der Standard Java Compiler, welcher den build-Prozess dann zwar als erfolgreich markiert, aber nichts macht, kompiliert ECJ auch fehlerhafte Klassen. Also zum Beispiel Klassen wo wiederum andere Klassen importiert werden, welche aber nicht im &#8220;Classpath&#8221; stehen. Denn ECJ bietet das Feature &#8220;proceedOnError&#8221;, welche durch &#8221;failonerror=off&#8221; gesetzt wird.</p>
<p><code> &lt;javac failonerror="off"&gt; blubb &lt;/javac&gt;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.zero0ne.de/2009/02/ant-ecj/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

