<?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>The Path to Zen &#187; ajax</title>
	<atom:link href="http://www.digizenstudio.com/blog/categories/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.digizenstudio.com/blog</link>
	<description>Jing Xue's Weblog</description>
	<lastBuildDate>Tue, 01 Jun 2010 01:40:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Why does the GWT compiler require an X server and how to work around it</title>
		<link>http://www.digizenstudio.com/blog/2008/05/12/why-does-the-gwt-compiler-require-an-x-server-and-how-to-work-around-it/</link>
		<comments>http://www.digizenstudio.com/blog/2008/05/12/why-does-the-gwt-compiler-require-an-x-server-and-how-to-work-around-it/#comments</comments>
		<pubDate>Tue, 13 May 2008 01:20:30 +0000</pubDate>
		<dc:creator>Jing Xue</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[gwt]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://www.digizenstudio.com/blog/2008/05/12/why-does-the-gwt-compiler-require-an-x-server-and-how-to-work-around-it/</guid>
		<description><![CDATA[Got this error today when trying to build our little GWT application in linux:
PLAIN TEXT
CODE:




Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using ':1' as the value of the DISPLAY variable.


&#160; &#160; at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)


&#160; &#160; at sun.awt.X11GraphicsEnvironment.access$000(X11GraphicsEnvironment.java:95)


&#160; &#160; at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:184)


&#160; &#160; at java.security.AccessController.doPrivileged(AccessController.java:193)


&#160; &#160; at sun.awt.X11GraphicsEnvironment.&#60;clinit&#62;(X11GraphicsEnvironment.java:173)


&#160; &#160; at java.lang.J9VMInternals.initializeImpl(Native Method)


&#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Got this error today when trying to build our little GWT application in linux:<span id="more-158"></span></p>
<div class="igBar"><span id="lcode-2"><a href="#" onclick="javascript:showPlainTxt('code-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-2">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Exception in thread <span style="color:#CC0000;">"main"</span> java.<span style="">lang</span>.<span style="">InternalError</span>: Can<span style="color:#CC0000;">'t connect to X11 window server using '</span>:1<span style="color:#CC0000;">' as the value of the DISPLAY variable.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at sun.awt.X11GraphicsEnvironment.access$000(X11GraphicsEnvironment.java:95)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:184)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at java.security.AccessController.doPrivileged(AccessController.java:193)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at sun.awt.X11GraphicsEnvironment.&lt;clinit&gt;(X11GraphicsEnvironment.java:173)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at java.lang.J9VMInternals.initializeImpl(Native Method)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at java.lang.J9VMInternals.initialize(J9VMInternals.java:192)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at java.lang.Class.forNameImpl(Native Method)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at java.lang.Class.forName(Class.java:130)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:101)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1174)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at com.google.gwt.user.rebind.ui.ImageBundleBuilder.drawBundledImage(ImageBundleBuilder.java:258)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at com.google.gwt.user.rebind.ui.ImageBundleBuilder.writeBundledImage(ImageBundleBuilder.java:108)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at com.google.gwt.user.rebind.ui.ImageBundleGenerator.generateImpl(ImageBundleGenerator.java:160)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at com.google.gwt.user.rebind.ui.ImageBundleGenerator.generate(ImageBundleGenerator.java:76)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:43)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.tryRebind(StandardRebindOracle.java:116)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:61)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:173)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at com.google.gwt.dev.GWTCompiler$DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(GWTCompiler.java:195)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds(WebModeCompilerFrontEnd.java:105)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at com.google.gwt.dev.jdt.AbstractCompiler$CompilerImpl.process(AbstractCompiler.java:137)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:329)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at com.google.gwt.dev.jdt.AbstractCompiler$CompilerImpl.compile(AbstractCompiler.java:74)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at com.google.gwt.dev.jdt.AbstractCompiler$CompilerImpl.compile(AbstractCompiler.java:162)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at com.google.gwt.dev.jdt.AbstractCompiler$CompilerImpl.access$600(AbstractCompiler.java:61)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at com.google.gwt.dev.jdt.AbstractCompiler.compile(AbstractCompiler.java:430)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.getCompilationUnitDeclarations(WebModeCompilerFrontEnd.java:65)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.&lt;init&gt;(JavaToJavaScriptCompiler.java:248)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at com.google.gwt.dev.GWTCompiler.distill(GWTCompiler.java:329)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at com.google.gwt.dev.GWTCompiler.run(GWTCompiler.java:755)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at com.google.gwt.dev.GWTCompiler.run(GWTCompiler.java:745)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#CC0000;">&nbsp; &nbsp; at com.google.gwt.dev.GWTCompiler.main(GWTCompiler.java:213) </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Apparently the GWT compiler tries to assemble some images into the client package, and in doing so triggers some parts in AWT that require an X display if $DISPLAY is set.  There seems to be two solutions:</p>
<ol>
<li>Make sure $DISPLAY is unset for your build environment.</li>
<li>Define a system property, <code>java.awt.headless=true</code>.  The twist here is that if you are using the GWT maven plugin, instead of directly specifying the property on maven's command line, it needs to be defined in the plugin's configuration in the form of:<br />
<code>&lt;extraJvmArgs&gt;-Djava.awt.headless=true&lt;/extraJvmArgs&gt;</code></li>
</ol>
<p></init></clinit></p>
]]></content:encoded>
			<wfw:commentRss>http://www.digizenstudio.com/blog/2008/05/12/why-does-the-gwt-compiler-require-an-x-server-and-how-to-work-around-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

