{"id":2950,"date":"2012-05-11T09:13:00","date_gmt":"2012-05-11T08:13:00","guid":{"rendered":"http:\/\/touk.pl\/blog\/?guid=38cdd4f65395f76233abd097b9df32c1"},"modified":"2022-07-26T12:58:08","modified_gmt":"2022-07-26T10:58:08","slug":"gwt-hosted-mode-on-64bit-linux","status":"publish","type":"post","link":"https:\/\/touk.pl\/blog\/2012\/05\/11\/gwt-hosted-mode-on-64bit-linux\/","title":{"rendered":"GWT Hosted mode on 64bit linux"},"content":{"rendered":"<p>GWT for linux is build against 32bit architecture. It contains some SWT\/GTK 32bit modules. So if you try to run it with 64bit java it fails<\/p>\n<p><em>Exception in thread &#8220;main&#8221; java.lang.UnsatisfiedLinkError: \/opt\/tools\/sdk\/gwt\/gwt-linux-1.5.3\/libswt-pi-gtk-3235.so: \/opt\/tools\/sdk\/gwt\/gwt-linux-1.5.3\/libswt-pi-gtk-3235.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)<br \/>\n\u00a0\u00a0\u00a0 at java.lang.ClassLoader$NativeLibrary.load(Native Method)<br \/>\n\u00a0\u00a0\u00a0 at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1807)<br \/>\n\u00a0\u00a0\u00a0 at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703)<br \/>\n\u00a0\u00a0\u00a0 at java.lang.Runtime.load0(Runtime.java:770)<br \/>\n\u00a0\u00a0\u00a0 at java.lang.System.load(System.java:1003)<br \/>\n\u00a0\u00a0\u00a0 at org.eclipse.swt.internal.Library.loadLibrary(Library.java:132)<br \/>\n\u00a0\u00a0\u00a0 at org.eclipse.swt.internal.gtk.OS.(OS.java:22)<br \/>\n\u00a0\u00a0\u00a0 at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)<br \/>\n\u00a0\u00a0\u00a0 at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)<br \/>\n\u00a0\u00a0\u00a0 at org.eclipse.swt.widgets.Display.(Display.java:126)<br \/>\n\u00a0\u00a0\u00a0 at com.google.gwt.dev.GWTShell.(GWTShell.java:301)<br \/>\nCould not find the main class: com.google.gwt.dev.GWTShell.\u00a0 Program will exit.<br \/>\n[INFO] &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\n[ERROR] BUILD ERROR<\/em><\/p>\n<p>You have two choices. Find 64bit SWT\/GTK modules with same build version (3235 in this case) &#8211; good luck! or download 32bit JRE.<\/p>\n<p>I chose second option and it took me 3 mins to resolve the problem.<br \/>\nFind proper JRE version on <a href=\"http:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/\">Oracle site<\/a> I suggest <em>bin<\/em> file instead rpm. It unpacks jre to own dir. Move that directory to some convenient location (it doesn&#8217;t matter where). Edit <em>gwt.properties *and set<\/em> java.executable* to <em>java<\/em> exec located in 32bit JRE.<br \/>\nNow run your GWT hosted mode and be unstoppable developer!<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\">\n  <a href=\"http:\/\/1.bp.blogspot.com\/-ocG6L2V13Ks\/T6zI0d5QuQI\/AAAAAAAAA9Q\/78FI5hsiuPg\/s1600\/gwt-32-64bit.png\" style=\"margin-left: 1em;margin-right: 1em\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" height=\"185\" src=\"http:\/\/1.bp.blogspot.com\/-ocG6L2V13Ks\/T6zI0d5QuQI\/AAAAAAAAA9Q\/78FI5hsiuPg\/s320\/gwt-32-64bit.png\" width=\"320\" \/><\/a>\n<\/div>\n<p>You may have some warnings from GTK, such as<\/p>\n<p><em>\/usr\/lib\/gtk-2.0\/2.10.0\/menuproxies\/libappmenu.so: wrong ELF class: ELFCLASS64<\/em><br \/>\n<em>(GWT:351): Gtk-WARNING **: Failed to load type module: \/usr\/lib\/gtk-2.0\/2.10.0<\/em><br \/>\n<em>\/menuproxies\/libappmenu.so<\/em><br \/>\n**<\/p>\n<p>But it has no consequences for me, so far&#8230;<\/p>\n<p>Some sources say that you should set an environment var:<\/p>\n<p><em>export LIBXCB_ALLOW_SLOPPY_LOCK=1<\/em><\/p>\n<p>to block bugs in X display layer but I don&#8217;t know what does it mean :)<\/p>\n<p><span style=\"font-size: x-small\"><i>In this case I had to hadle with GWT version 1.5.3 (old corporate project)<\/i><\/span><\/p>\n<pre class=\"screen\"><code class=\"literal\"> <\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"GWT for linux is build against 32bit architecture. It contains some SWT\/GTK 32bit modules. So if you try to run it with 64bit java it failsException in thread &#8220;main&#8221; java.lang.UnsatisfiedLinkError: \/opt\/tools\/sdk\/gwt\/gwt-linux-1.5.3\/libswt-pi-gtk-3235&#8230;.\n","protected":false},"author":22,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[71,28,68],"class_list":{"0":"post-2950","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-development-design","7":"tag-frontend","8":"tag-gwt","9":"tag-java"},"_links":{"self":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/2950","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/comments?post=2950"}],"version-history":[{"count":9,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/2950\/revisions"}],"predecessor-version":[{"id":14328,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/2950\/revisions\/14328"}],"wp:attachment":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/media?parent=2950"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/categories?post=2950"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/tags?post=2950"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}