<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9070584894769149908</id><updated>2011-08-15T18:17:25.516-07:00</updated><title type='text'>Jarle Hansen's Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://hansjar.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9070584894769149908/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://hansjar.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jarle Hansen</name><uri>http://www.blogger.com/profile/12306986377142218956</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9070584894769149908.post-463838407604181053</id><published>2011-02-26T01:31:00.001-08:00</published><updated>2011-02-26T01:31:50.167-08:00</updated><title type='text'>protobuf-javame 1.1.0 released</title><content type='html'>Added support for using repeated (lists) on custom types. For more information go to the &lt;a href="http://code.google.com/p/protobuf-javame/wiki/UserDocumentation" rel="nofollow"&gt;user documentation&lt;/a&gt;, Recursion section.&lt;br /&gt;&lt;br /&gt;Project webpage: &lt;a href="http://code.google.com/p/protobuf-javame/"&gt;http://code.google.com/p/protobuf-javame/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9070584894769149908-463838407604181053?l=hansjar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hansjar.blogspot.com/feeds/463838407604181053/comments/default' title='Legg inn kommentarer'/><link rel='replies' type='text/html' href='http://hansjar.blogspot.com/2011/02/protobuf-javame-110-released.html#comment-form' title='0 Kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9070584894769149908/posts/default/463838407604181053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9070584894769149908/posts/default/463838407604181053'/><link rel='alternate' type='text/html' href='http://hansjar.blogspot.com/2011/02/protobuf-javame-110-released.html' title='protobuf-javame 1.1.0 released'/><author><name>Jarle Hansen</name><uri>http://www.blogger.com/profile/12306986377142218956</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9070584894769149908.post-498195759883248130</id><published>2010-10-02T05:18:00.000-07:00</published><updated>2010-10-13T03:25:33.753-07:00</updated><title type='text'>Microlog4android, 1.0-version released</title><content type='html'>Try it out at: &lt;a href="http://code.google.com/p/microlog4android/"&gt;http://code.google.com/p/microlog4android/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Lots ideas, too little time, so we are also looking for developers to help us out.&lt;br /&gt;If you are interested in open source and Android development please contact us (either &lt;a href="http://myossdevblog.blogspot.com/"&gt;Johan&lt;/a&gt; or me: hansjar at gmail dot com).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9070584894769149908-498195759883248130?l=hansjar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hansjar.blogspot.com/feeds/498195759883248130/comments/default' title='Legg inn kommentarer'/><link rel='replies' type='text/html' href='http://hansjar.blogspot.com/2010/10/microlog4android-10-verison-released.html#comment-form' title='0 Kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9070584894769149908/posts/default/498195759883248130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9070584894769149908/posts/default/498195759883248130'/><link rel='alternate' type='text/html' href='http://hansjar.blogspot.com/2010/10/microlog4android-10-verison-released.html' title='Microlog4android, 1.0-version released'/><author><name>Jarle Hansen</name><uri>http://www.blogger.com/profile/12306986377142218956</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9070584894769149908.post-4972140452880384843</id><published>2010-09-05T06:19:00.001-07:00</published><updated>2010-09-05T06:21:48.074-07:00</updated><title type='text'>protobuf-javame 1.0.0 released</title><content type='html'>Finally, 1.0.0 version of the protobuf-javame project is released.&lt;br /&gt;The main features added in the new release are support for nested messages and enums.&lt;br /&gt;&lt;br /&gt;Please try it out and let me know what you think :)&lt;br /&gt;&lt;a href="http://code.google.com/p/protobuf-javame/"&gt;protobuf-javame&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9070584894769149908-4972140452880384843?l=hansjar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hansjar.blogspot.com/feeds/4972140452880384843/comments/default' title='Legg inn kommentarer'/><link rel='replies' type='text/html' href='http://hansjar.blogspot.com/2010/09/protobuf-javame-100-released.html#comment-form' title='0 Kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9070584894769149908/posts/default/4972140452880384843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9070584894769149908/posts/default/4972140452880384843'/><link rel='alternate' type='text/html' href='http://hansjar.blogspot.com/2010/09/protobuf-javame-100-released.html' title='protobuf-javame 1.0.0 released'/><author><name>Jarle Hansen</name><uri>http://www.blogger.com/profile/12306986377142218956</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9070584894769149908.post-5277627340133966302</id><published>2010-06-02T14:34:00.000-07:00</published><updated>2010-06-02T14:44:50.996-07:00</updated><title type='text'>Using Bluetooth and Microlog, updated</title><content type='html'>I previously described &lt;a href="http://hansjar.blogspot.com/2009/06/using-microlog-over-bluetooth-with.html"&gt;how to use the Bluetooth logging features&lt;/a&gt; (both appender and server) in Microlog with Ubuntu. There has been a few updates to Microlog that changes a few small details of this earlier blog post.&lt;br /&gt;&lt;br /&gt;The following setup should now be used:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;The Ubuntu package “&lt;span style="font-style: italic;"&gt;libbluetooth-dev&lt;/span&gt;”&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt; &lt;/span&gt;&lt;/span&gt;still needs to be installed.&lt;/li&gt;&lt;li&gt;Download bluecove jar files (use 2.1.1 snapshot and download both the standard jar and the gpl jar-file).&lt;/li&gt;&lt;li&gt;Download the &lt;a href="http://sourceforge.net/projects/microlog/files/"&gt;microlog distribution&lt;/a&gt;. The Bluetooth server is the file called microlog-server-bluetooth-{version}.jar. Put all the jar files in the same folder and create a start script.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Create a startup script for the server. This updated script will use the new main class and does not have any hardcoded version numbers.&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: courier new;"&gt;bluecove&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl sym"&gt;=&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;$&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl sym"&gt;(&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl kwc"&gt;ls&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; bluecove&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl sym"&gt;-[&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl num"&gt;0&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl sym"&gt;-&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl num"&gt;9&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl sym"&gt;]&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;.&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl sym"&gt;*&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;.jar&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl sym"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;bluecovegpl&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl sym"&gt;=&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;$&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl sym"&gt;(&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl kwc"&gt;ls&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; bluecove&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl sym"&gt;-&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;gpl&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl sym"&gt;-*&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;.jar&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl sym"&gt;)&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&lt;br /&gt;microlog&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl sym"&gt;=&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;$&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl sym"&gt;(&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl kwc"&gt;ls&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; microlog&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl sym"&gt;-&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;server&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl sym"&gt;-&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;bluetooth&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl sym"&gt;-*&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;.jar&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl sym"&gt;)&lt;/span&gt;&lt;span style="font-family: courier new;" class="hl kwb"&gt;&lt;br /&gt;echo&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;" class="hl str"&gt;"The Microlog Bluetooth server loading: "&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;" class="hl kwb"&gt;$bluecove $bluecovegpl $microlog&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: courier new;"&gt;&lt;br /&gt;gksu &lt;/span&gt;&lt;span style="font-family: courier new;" class="hl str"&gt;"java -cp $bluecovegpl:$bluecove:$microlog net.sf.microlog.server.btspp.gui.MicrologBluetoothServerUI"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-family: arial;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;If you have any problems with this script please let me know!&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9070584894769149908-5277627340133966302?l=hansjar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hansjar.blogspot.com/feeds/5277627340133966302/comments/default' title='Legg inn kommentarer'/><link rel='replies' type='text/html' href='http://hansjar.blogspot.com/2010/06/using-bluetooth-and-microlog-updated.html#comment-form' title='0 Kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9070584894769149908/posts/default/5277627340133966302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9070584894769149908/posts/default/5277627340133966302'/><link rel='alternate' type='text/html' href='http://hansjar.blogspot.com/2010/06/using-bluetooth-and-microlog-updated.html' title='Using Bluetooth and Microlog, updated'/><author><name>Jarle Hansen</name><uri>http://www.blogger.com/profile/12306986377142218956</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9070584894769149908.post-5588113703436757132</id><published>2010-02-14T02:48:00.000-08:00</published><updated>2010-02-14T03:40:33.587-08:00</updated><title type='text'>How I use IntelliJ IDEA 9 and Gradle</title><content type='html'>The newest version of IntelliJ IDEA includes a few very nice gradle features, &lt;a href="http://blogs.jetbrains.com/idea/2009/08/gradle-support/"&gt;reference1&lt;/a&gt; &lt;a href="http://mrhaki.blogspot.com/2009/10/use-gradle-support-in-intellij-idea.html"&gt;reference2&lt;/a&gt; &lt;a href="http://kensipe.blogspot.com/2009/12/intellij-9-and-gradle.html"&gt;reference3&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Running gradle tasks works by simply opening the build.gradle file and pressing ctrl+shift+f10, this will run the tasks specified as "defaultTasks". If you want to run a specific task you just have to select it and press the same key combination. Nice!&lt;br /&gt;&lt;br /&gt;I just wanted to share how I use a few other features as well. Many times I find myself wanting to use tasks that are not directly implemented in my own build script, but added by a plugin. One example is the "eclipse" plugin, since gradle does not (as of version 0.8) support the creation of IntelliJ IDEA project files. This is identified in the missing features section of the user guide:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Creating IDE project and classpath files for IntelliJ and NetBeans. Gradle supports IDE project file generation for Eclipse.&lt;/li&gt;&lt;/ul&gt;So, to be able to run these tasks I have created an "External tools" entry specifically for custom tasks. In IntelliJ open Settings -&gt; External tools and press Add. Point to gradle_home in program. When you add $Prompt$ to Parameters this means you will get an input dialog when you run the task. In Working directory add $ProjectFileDir$, this will make sure it runs from your project directory.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Aru2_gI-IjE/S3fZq_04uRI/AAAAAAAAABY/xY7XX0NxB2U/s1600-h/custom-task.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 216px;" src="http://1.bp.blogspot.com/_Aru2_gI-IjE/S3fZq_04uRI/AAAAAAAAABY/xY7XX0NxB2U/s400/custom-task.png" alt="" id="BLOGGER_PHOTO_ID_5438054407784151314" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;When you run this task you will be able to enter a custom task, like "eclipse" or "-t" (list all available tasks). The tasks you enter here does not need to be specified in "defaultTasks" or directly in build.gradle.&lt;br /&gt;&lt;br /&gt;If you use the &lt;a href="http://www.gradle.org/0.8/docs/userguide/artifact_dependencies_tutorial.html#N10680"&gt;gradle dependency management&lt;/a&gt; you can now easily generate the eclipse project files by running the "custom task" and entering eclipse. In IntelliJ IDEA you can then import these project files by pressing File -&gt; Open Project... and selecting the newly generated eclipse .project-file. IntelliJ will then prompt for your input on how to import the project settings. I usually select Reimport -&gt; Yes (you want to reuse the project files) -&gt; This window.&lt;br /&gt;&lt;br /&gt;You have now generated the project files with all dependencies from the build script. Be aware of one issue; make sure you check that the Modules -&gt; Sources under Project Structure is correct. Sometimes it adds a few of the Test Source Folders under Source Folders. Just take a quick look and verify that everything looks correct.&lt;br /&gt;&lt;br /&gt;Once you have done it a few times this process only takes  a few seconds. Also it makes the build.gradle file the only place you need to keep track of your dependencies. I have been mixing project-local and repository dependencies in several of my own project, and this method works execellent when setting up your development environment.&lt;br /&gt;&lt;br /&gt;Lets just hope the next gradle version includes an IntelliJ IDEA plugin...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9070584894769149908-5588113703436757132?l=hansjar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hansjar.blogspot.com/feeds/5588113703436757132/comments/default' title='Legg inn kommentarer'/><link rel='replies' type='text/html' href='http://hansjar.blogspot.com/2010/02/how-i-use-intellij-idea-9-and-gradle.html#comment-form' title='2 Kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9070584894769149908/posts/default/5588113703436757132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9070584894769149908/posts/default/5588113703436757132'/><link rel='alternate' type='text/html' href='http://hansjar.blogspot.com/2010/02/how-i-use-intellij-idea-9-and-gradle.html' title='How I use IntelliJ IDEA 9 and Gradle'/><author><name>Jarle Hansen</name><uri>http://www.blogger.com/profile/12306986377142218956</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_Aru2_gI-IjE/S3fZq_04uRI/AAAAAAAAABY/xY7XX0NxB2U/s72-c/custom-task.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9070584894769149908.post-3129802458678140873</id><published>2009-06-20T14:21:00.000-07:00</published><updated>2009-06-21T07:13:28.902-07:00</updated><title type='text'>Using MicroLog over Bluetooth with Ubuntu and Eclipse</title><content type='html'>&lt;style type="text/css"&gt; @page { margin: 0.79in }   P { margin-bottom: 0.08in }   A:link { so-language: zxx }  --&gt;  &lt;/style&gt;  &lt;p style="margin-bottom: 0in;"&gt;MicroLog is a great tool for logging in Java ME. One of the cool features that is supported is logging over Bluetooth. This means that you can easily set up the application to connect to a lightweight server application running on your computer. MicroLog takes care of all the boilerplate code associated with creating the Bluetooth connection, sending the data and so on. All you have to do is add a BluetoothSerialAppender to you Logger-object and you are good to go (for more information on implementation details: &lt;a href="http://blog.jayway.com/2008/12/17/java-me-logging-over-bluetooth-using-microlog/"&gt;http://blog.jayway.com/2008/12/17/java-me-logging-over-bluetooth-using-microlog/&lt;/a&gt;). The Bluetooth server is a small application that accepts connections from the clients and prints them out to the console.&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;The main purpose of this article is to show how you can use the Bluetooth feature of MicroLog with Ubuntu and Eclipse. There are some additional challenges when using Linux and MicroLog, but as presented here they are not too hard to fix. The jar-files used in this example are snapshot versions, so do not be surprised if you find a few bugs.&lt;/p&gt;&lt;p style="margin-bottom: 0in; font-weight: bold;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in; font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;Making the MicroLog server compatible with Ubuntu&lt;/span&gt;     &lt;style type="text/css"&gt;  &lt;!--   @page { margin: 0.79in }   P { margin-bottom: 0.08in }   A:link { so-language: zxx }  --&gt;  &lt;/style&gt;  &lt;/p&gt;&lt;p style="margin-bottom: 0in; font-weight: normal;"&gt;The first problem I had was with the MicroLog server. I use Ubuntu for all my tasks, including software development and the BlueCove version included in the MicroLog server package (microlog-servers-&lt;version&gt;jar-with-dependencies.jar) was not compatible with the OS. It did not start and printed out this error message:&lt;/version&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in; font-weight: normal; font-style: italic;"&gt;BluetoothSerialServerThread started.  &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-weight: normal; font-style: italic;"&gt;Failed to init the Bluetooth connection. javax.bluetooth.BluetoothStateException: BlueCove com.intel.bluetooth.BluetoothStackBlueZ not available  &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-weight: normal; font-style: italic;"&gt;We are finally closing the logging.&lt;/p&gt;  &lt;p style="margin-bottom: 0in; font-weight: normal;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in; font-weight: normal;"&gt;BlueCove is the Bluetooth library used in the MicroLog server library. It does support Linux, but the difference from the Windows version is that you have to add an additional runtime library called BlueCove-GPL. First, to get Bluetooth on Ubuntu working with BlueCove you have to download and install an extra package. Open up Synaptic Package Manager or a terminal window and install the “&lt;span style="font-style: italic;"&gt;libbluetooth-dev&lt;/span&gt;” package. When this is installed go to &lt;a href="http://www.bluecove.org/"&gt;http://www.bluecove.org&lt;/a&gt; and download the Java library. I would recommend the snapshot version (2.1.1) since the current stable version (2.1.0) has a few problematic bugs. Place these two files together with the Microlog server application.&lt;/p&gt; &lt;ul style="font-weight: normal;"&gt;&lt;p style="margin-bottom: 0in; font-weight: bold;"&gt;Download these files to the same  folder:&lt;/p&gt;&lt;li style="font-style: italic;"&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://snapshot.bluecove.org/distribution/download/2.1.1-SNAPSHOT/2.1.1-SNAPSHOT.48/bluecove-2.1.1-SNAPSHOT.jar"&gt;http://snapshot.bluecove.org/distribution/download/2.1.1-SNAPSHOT/2.1.1-SNAPSHOT.48/bluecove-2.1.1-SNAPSHOT.jar&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/li&gt;&lt;li style="font-style: italic;"&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://snapshot.bluecove.org/distribution/download/2.1.1-SNAPSHOT/2.1.1-SNAPSHOT.48/bluecove-gpl-2.1.1-SNAPSHOT.jar"&gt;http://snapshot.bluecove.org/distribution/download/2.1.1-SNAPSHOT/2.1.1-SNAPSHOT.48/bluecove-gpl-2.1.1-SNAPSHOT.jar&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/li&gt;&lt;li style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://sourceforge.net/project/downloading.php?group_id=138008&amp;amp;filename=microlog-servers-2.0.0-SNAPSHOT-jar-with-dependencies.jar&amp;amp;a=97806068"&gt;http://sourceforge.net/project/downloading.php?group_id=138008&amp;amp;filename=microlog-servers-2.0.0-SNAPSHOT-jar-with-dependencies.jar&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;You can download the file microlog-servers-2.0.0-SNAPSHOT.jar as well, to avoid having unnecessary BlueCove dependencies.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p style="margin-bottom: 0in; font-weight: normal;"&gt;The next step is to create a shell script that will start the server application. Open a terminal window and type “&lt;span style="font-style: italic;"&gt;gedit start-microlog-server.sh&lt;/span&gt;” (you can call the file whatever you want). Copy and past this into the file:&lt;/p&gt; &lt;p style="margin-bottom: 0in; font-weight: normal; font-style: italic;"&gt;java -cp bluecove-2.1.1-SNAPSHOT.jar:bluecove-gpl-2.1.1-SNAPSHOT.jar:microlog-servers-2.0.0-SNAPSHOT-jar-with-dependencies.jar net.sf.microlog.server.btspp.MicrologBtsppServer&lt;/p&gt;  &lt;p style="margin-bottom: 0in; font-weight: normal;"&gt;Make sure all the version numbers are correct and that you have the jar-files in the same folder as the script. If you choose to use the microlog-servers-2.0.0-SNAPSHOT.jar file you have to update the script with this file. Also, if you get an error message like this:&lt;/p&gt;&lt;p style="margin-bottom: 0in; font-weight: normal;"&gt;&lt;span style="font-style: italic;"&gt;Failed to init the Bluetooth connection. javax.bluetooth.BluetoothStateException: Bluetooth Device is not ready. [1] Operation not permitted&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in; font-weight: normal;"&gt;Try to add&lt;span style="font-style: italic;"&gt; gksu &lt;/span&gt;in front and "-around the java -cp....&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in; font-weight: normal;"&gt;This will start the MicroLog Bluetooth server application with the correct BlueCove jar-files. Save and close gedit. This is the script that Eclipse will run and therefore it needs to be executable. In the terminal write “&lt;span style="font-style: italic;"&gt;chmod u+x start-microlog-server.sh&lt;/span&gt;”. You can now test that the script works by entering the following command in the terminal “&lt;span style="font-style: italic;"&gt;sh start-microlog-server.sh&lt;/span&gt;”. You should see something like this:&lt;/p&gt; &lt;p style="margin-bottom: 0in; font-style: italic; font-weight: normal;"&gt;BluetoothSerialServerThread started.  &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-style: italic; font-weight: normal;"&gt;BlueCove version 2.1.1-SNAPSHOT on bluez  &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-style: italic; font-weight: normal;"&gt;Waiting for a client to connect to:&lt;br /&gt;btspp://000000000000:&lt;channel&gt;;authenticate=false;encrypt=false;master=false&lt;br /&gt;where &lt;channel&gt; should be replaced with the channel that is actually in use. This is usually a low number 1 or 2.&lt;/channel&gt;&lt;/channel&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;Integrate MicroLog with Eclipse&lt;style type="text/css"&gt;  &lt;!--   @page { margin: 0.79in }   P { margin-bottom: 0.08in }  --&gt;  &lt;/style&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;The second task is to get this integrated in Eclipse. It is good to have access to the terminal application, but much nicer to get the log output in Eclipse. All you need to do is add a new “External tools” configuration.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Aru2_gI-IjE/Sj1TmkRgHPI/AAAAAAAAAAM/JERXbQvOe-w/s1600-h/external-tools1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 78px;" src="http://2.bp.blogspot.com/_Aru2_gI-IjE/Sj1TmkRgHPI/AAAAAAAAAAM/JERXbQvOe-w/s320/external-tools1.jpg" alt="" id="BLOGGER_PHOTO_ID_5349523854423235826" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;   &lt;p style="margin-bottom: 0in; font-weight: normal;"&gt;Press the “New launch configuration” and enter a name, like “&lt;span style="font-style: italic;"&gt;microlog bluetooth server&lt;/span&gt;”. In the location input field, press either “&lt;span style="font-style: italic;"&gt;Browse Workspace&lt;/span&gt;” (like in the picture below) or “&lt;span style="font-style: italic;"&gt;Browse File System&lt;/span&gt;”. This depends on where you have saved the shell script. Select the “&lt;span style="font-style: italic;"&gt;start-microlog-server.sh&lt;/span&gt;” file and press OK. In the working directory select the folder where the shell script is and press OK. The working directory must be the same folder as where all the jar-files were saved. Finally press Apply to save the changes.&lt;/p&gt; &lt;p style="margin-bottom: 0in; font-weight: normal;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Aru2_gI-IjE/Sj1UQKy33QI/AAAAAAAAAAk/dHQgn17d9Wg/s1600-h/external-tools2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 304px;" src="http://3.bp.blogspot.com/_Aru2_gI-IjE/Sj1UQKy33QI/AAAAAAAAAAk/dHQgn17d9Wg/s400/external-tools2.jpg" alt="" id="BLOGGER_PHOTO_ID_5349524569138388226" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in; font-weight: normal;"&gt;Now you should be able to run the “&lt;span style="font-style: italic;"&gt;External tools&lt;/span&gt;” configuration and start the MicroLog server in Eclipse. The output should be similar to this:&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_Aru2_gI-IjE/Sj1UVCqjt9I/AAAAAAAAAAs/wMBhLsbenss/s1600-h/console.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 77px;" src="http://3.bp.blogspot.com/_Aru2_gI-IjE/Sj1UVCqjt9I/AAAAAAAAAAs/wMBhLsbenss/s400/console.jpg" alt="" id="BLOGGER_PHOTO_ID_5349524652855375826" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_Aru2_gI-IjE/Sj1UFgfo4WI/AAAAAAAAAAc/dn7_mY3abTU/s1600-h/console.jpg"&gt;&lt;/a&gt;&lt;p style="margin-bottom: 0in; font-weight: normal;"&gt;This has been a great help for me since I really like having everything included in Eclipse. Hopefully this can help others to get MicroLog up and running on Linux and in Eclipse as well. Please do not hesitate to add a comment if you have any questions.&lt;/p&gt; &lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9070584894769149908-3129802458678140873?l=hansjar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hansjar.blogspot.com/feeds/3129802458678140873/comments/default' title='Legg inn kommentarer'/><link rel='replies' type='text/html' href='http://hansjar.blogspot.com/2009/06/using-microlog-over-bluetooth-with.html#comment-form' title='8 Kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9070584894769149908/posts/default/3129802458678140873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9070584894769149908/posts/default/3129802458678140873'/><link rel='alternate' type='text/html' href='http://hansjar.blogspot.com/2009/06/using-microlog-over-bluetooth-with.html' title='Using MicroLog over Bluetooth with Ubuntu and Eclipse'/><author><name>Jarle Hansen</name><uri>http://www.blogger.com/profile/12306986377142218956</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_Aru2_gI-IjE/Sj1TmkRgHPI/AAAAAAAAAAM/JERXbQvOe-w/s72-c/external-tools1.jpg' height='72' width='72'/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9070584894769149908.post-1898224272058144584</id><published>2009-02-12T13:29:00.000-08:00</published><updated>2009-02-12T14:32:10.752-08:00</updated><title type='text'>Ant, Maven, Gant &amp; Gradle</title><content type='html'>&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;For Java there are a range of different build tools/systems available. It can be difficult to know what is the best choice for &lt;span style="font-style: italic;"&gt;your&lt;/span&gt; project. And to make things even worse there is no right or wrong answer. I will try to give a short introduction to some of the more popular tools starting with good old Ant. For each tool I will give a compact HelloWorld example to show the differences, it uses two dependencies (spring and commons-logging) to show how the tools handles dependency management. The examples are not complete. To make them easy to read I have only added a few of the important elements.&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);font-size:100%;" &gt;Ant&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;Ant is a Java-based build tool that uses xml-files to define the build commands. It supports a wide range of tasks and if you for some reason can't find one for your needs you can always create your own (&lt;a href="http://ant.apache.org/manual/develop.html"&gt;http://ant.apache.org/manual/develop.html&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;There is no doubt that Ant is a good and powerful tool, but it has several well-known problems. First of all xml is not a programming language, this can make it difficult to do simple tasks like if-statements and loops (it is certainly possible to get it done, but often it becomes complex and hard to read). Secondly the build-files quickly become very verbose.&lt;br /&gt;&lt;br /&gt;The example below shows two simple targets, &lt;span style="font-style: italic;"&gt;compile&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;package.jar&lt;/span&gt;. Despite the problems mentioned earlier, I like Ant. You have total control of what is going on and it supports just about everything you would need to do in a build.&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;blockquote&gt;&lt;pre&gt;&lt;span style="font-weight: normal;"&gt;&amp;lt;path id="lib.classpath"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;    &amp;lt;fileset dir="${lib.dir}"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;        &amp;lt;include name="*.jar"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;    &amp;lt;/fileset&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;&amp;lt;/path&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;&amp;lt;target name="compile" depends="init"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;    &amp;lt;javac srcdir="${src.dir}" destdir="${build.dir}" classpathref="lib.classpath" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;&amp;lt;/target&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;&amp;lt;target name="package.jar" depends="compile"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;    &amp;lt;jar basedir="${build.dir}" destfile="${jar.filepath}"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;        &amp;lt;manifest&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;            &amp;lt;attribute name="Main-Class" value="${main.class}" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;            &amp;lt;attribute name="Class-Path" value="${classpath.entries}" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;        &amp;lt;/manifest&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;        &amp;lt;fileset dir="${res.dir}"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;            &amp;lt;include name="*.xml" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;        &amp;lt;/fileset&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;    &amp;lt;/jar&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;&amp;lt;/target&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;span&gt;Maven&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;Maven has tried to solve most of the problems with Ant. Maven attempts to create a standard way to build projects and make the build process easy. Like Ant it uses xml-files for the build configuration. In addition to supporting regular tasks like compiling code it adds support for dependency management. The main issue with maven, in my opinion at least, is the lack of flexibility. You are basically locked in the default configuration, &lt;span style="font-style: italic;"&gt;convention over configuration&lt;/span&gt;, making it a real pain if you need something different. There are other issues as well, like repository problems, but lets just go on with the example.&lt;br /&gt;&lt;br /&gt;Continuing with the HelloWorld example, here is the pom.xml file:&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;blockquote style="color: rgb(0, 0, 0);"&gt;&lt;pre&gt;&lt;span style="font-size:100%;"&gt;&amp;lt;project&amp;gt;&lt;br /&gt;&amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt;&lt;br /&gt;&amp;lt;groupId&amp;gt;net.jarlehansen.helloworld.maven&lt;br /&gt;&amp;lt;/groupId&amp;gt;&lt;br /&gt;&amp;lt;artifactId&amp;gt;maven-helloworld&amp;lt;/artifactId&amp;gt;&lt;br /&gt;&amp;lt;name&amp;gt;Maven HelloWorld&amp;lt;/name&amp;gt;&lt;br /&gt;&amp;lt;version&amp;gt;1.0.0&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;lt;packaging&amp;gt;jar&amp;lt;/packaging&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;dependencies&amp;gt;&lt;br /&gt;&amp;lt;dependency&amp;gt;&lt;br /&gt;&amp;lt;groupId&amp;gt;org.springframework&amp;lt;/groupId&amp;gt;&lt;br /&gt;&amp;lt;artifactId&amp;gt;spring&amp;lt;/artifactId&amp;gt;&lt;br /&gt;&amp;lt;version&amp;gt;2.5.6&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;lt;scope&amp;gt;compile&amp;lt;/scope&amp;gt;&lt;br /&gt;&amp;lt;/dependency&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;dependency&amp;gt;&lt;br /&gt;&amp;lt;groupId&amp;gt;commons-logging&amp;lt;/groupId&amp;gt;&lt;br /&gt;&amp;lt;artifactId&amp;gt;commons-logging&amp;lt;/artifactId&amp;gt;&lt;br /&gt;&amp;lt;version&amp;gt;1.1.1&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;lt;scope&amp;gt;compile&amp;lt;/scope&amp;gt;&lt;br /&gt;&amp;lt;/dependency&amp;gt;&lt;br /&gt;&amp;lt;/dependencies&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;build&amp;gt;&lt;br /&gt;&amp;lt;plugins&amp;gt;&lt;br /&gt;&amp;lt;plugin&amp;gt;&lt;br /&gt;  &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;&lt;br /&gt;  &amp;lt;artifactId&amp;gt;maven-jar-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;  &amp;lt;configuration&amp;gt;&lt;br /&gt;      &amp;lt;archive&amp;gt;&lt;br /&gt;          &amp;lt;manifest&amp;gt;&lt;br /&gt;              &amp;lt;mainClass&amp;gt;net.jarlehansen.helloworld.maven.HelloWorldMain&lt;br /&gt;              &amp;lt;/mainClass&amp;gt;&lt;br /&gt;              &amp;lt;addClasspath&amp;gt;true&amp;lt;/addClasspath&amp;gt;&lt;br /&gt;          &amp;lt;/manifest&amp;gt;&lt;br /&gt;      &amp;lt;/archive&amp;gt;&lt;br /&gt;  &amp;lt;/configuration&amp;gt;&lt;br /&gt;&amp;lt;/plugin&amp;gt;&lt;br /&gt;&amp;lt;/plugins&amp;gt;&lt;br /&gt;&amp;lt;/build&amp;gt;&lt;br /&gt;&amp;lt;/project&amp;gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;When following the standard Maven project layout (&lt;a href="http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html"&gt;http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html&lt;/a&gt;) it will compile and package the source code. In this case a jar-file is created.&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;Gant&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;Gant tries to take a different approach, instead of using xml it supports Ant tasks with Groovy. By getting rid of the xml and adding an actual programming language it should solve all the problems right? Well, I haven't used it in any large projects, but I must admit I really like the idea.&lt;br /&gt;&lt;br /&gt;The example shows how it uses the same tasks as Ant, but with Groovy syntax:&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;blockquote&gt;&lt;pre style="font-weight: normal;"&gt;&lt;br /&gt;includeTargets &amp;lt;&amp;lt; gant.targets.Clean&lt;br /&gt;cleanDirectory &amp;lt;&amp;lt; targetDir&lt;br /&gt;&lt;br /&gt;ant.path(id : 'libClasspath') {&lt;br /&gt; fileset(dir : libDir, includes : '*.jar')&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt; target(compile : 'Compiles source code') {&lt;br /&gt; depends(init)&lt;br /&gt; echo('compile')&lt;br /&gt;&lt;br /&gt; ant.javac(srcdir : srcDir, destdir : buildDir, classpathref : 'libClasspath')&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;target(packageJar : 'Package the class files in a jar file') {&lt;br /&gt; depends(compile)&lt;br /&gt; echo('packageJar')&lt;br /&gt;&lt;br /&gt; ant.jar(destfile : jarFilepath, basedir : buildDir) {&lt;br /&gt; manifest() {&lt;br /&gt;   attribute(name : 'Main-Class', value : 'net.jarlehansen.helloworld.gant.HelloWorldMain')&lt;br /&gt;   attribute(name : 'Class-Path', value : '../lib/spring.jar ../lib/commons-logging.jar')&lt;br /&gt; }&lt;br /&gt;fileset(dir : resDir, includes : '*.xml')&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;setDefaultTarget (packageJar)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;Gradle&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;Gradle tries to behave more like Maven than Ant. Like Gant, it uses Groovy. And instead of the flexibility issues with Maven, it offers the best of both worlds. You can use the conventions from Maven,&lt;span style="font-weight: bold;"&gt; if you want to&lt;/span&gt;. Another pleasant sight is that Ant tasks are first class citizens. I really can't stand the AntRun plugin for Maven. In Gradle it is very simple to use Ant tasks, for example: &lt;span style="font-style: italic;"&gt;ant.echo('hello')&lt;/span&gt;. One of the major issues I have found with both Gant and Gradle are the lack of IDE support. This will probably improve when these tools get more mature, but at the moment it is not available.&lt;br /&gt;&lt;br /&gt;The example shows how Gradle can use the Maven repository to download the dependencies. It also compiles and packages the jar-file just like all the other examples (this is due to the 'java'-plugin):&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;blockquote&gt;&lt;pre style="font-weight: normal;"&gt;usePlugin('java')&lt;br /&gt;&lt;br /&gt;sourceCompatibility = '1.5'&lt;br /&gt;targetCompatibility = '1.5'&lt;br /&gt;&lt;br /&gt;project.group = "net.jarlehansen.helloworld.gradle"&lt;br /&gt;project.version = "1.0.0"&lt;br /&gt;manifest.mainAttributes("Main-Class" : "net.jarlehansen.helloworld.gradle.HelloWorldMain",&lt;br /&gt;                                      "Class-Path" : "../lib/spring-2.5.6.jar ../lib/commons-logging-1.1.1.jar")&lt;br /&gt;&lt;br /&gt;defaultTasks 'libs'&lt;br /&gt;&lt;br /&gt;dependencies {&lt;br /&gt; addMavenRepo()&lt;br /&gt; compile "org.springframework:spring:2.5.6"&lt;br /&gt; compile "commons-logging:commons-logging:1.1.1"&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;Conclusion&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;What is the best build tool? In my opinion the use of Groovy scripts for the builds makes a lot sense. And I must admit that both Gant and Gradle has a lot of potential. Hopefully the IDE support will arrive soon. In any case I will start using Gradle on a regular basis.&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;span&gt;&lt;span style="font-weight: bold;"&gt;References&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul style="font-weight: bold; color: rgb(0, 0, 0);"&gt;&lt;li style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt;Ant vs Maven, Episode 2 : Gant or Gradle? - &lt;a href="http://codetojoy.blogspot.com/2008/10/ant-vs-maven-episode-2-gant-or-gradle.html"&gt;http://codetojoy.blogspot.com/2008/10/ant-vs-maven-episode-2-gant-or-gradle.html&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt;alternatives to ant: gant, gradle and pjmake - &lt;a href="http://blog.punchbarrel.com/2008/09/29/alternatives-to-ant-gant-gradle-and-pjmake/"&gt;http://blog.punchbarrel.com/2008/09/29/alternatives-to-ant-gant-gradle-and-pjmake/&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt;Why maven sucks! - &lt;a href="http://www.jumpingbean.co.za/blogs/mark/maven_problems"&gt;http://www.jumpingbean.co.za/blogs/mark/maven_problems&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt;The Problem With Maven - &lt;a href="http://www.alittlemadness.com/2007/08/01/the-problem-with-maven/"&gt;http://www.alittlemadness.com/2007/08/01/the-problem-with-maven/&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="font-weight: normal;"&gt;&lt;span style="font-size:85%;"&gt;XML is not the build system you're looking for - &lt;a href="http://paulgrenyer.blogspot.com/2008/08/xml-is-not-build-system-youre-looking.html"&gt;http://paulgrenyer.blogspot.com/2008/08/xml-is-not-build-system-youre-looking.html&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: normal;font-size:85%;" &gt;Maven - Pain = Gradle? - &lt;a href="http://www.alittlemadness.com/2008/11/28/maven-pain-gradle/"&gt;http://www.alittlemadness.com/2008/11/28/maven-pain-gradle/&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9070584894769149908-1898224272058144584?l=hansjar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hansjar.blogspot.com/feeds/1898224272058144584/comments/default' title='Legg inn kommentarer'/><link rel='replies' type='text/html' href='http://hansjar.blogspot.com/2009/02/ant-maven-gant-gradle.html#comment-form' title='0 Kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9070584894769149908/posts/default/1898224272058144584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9070584894769149908/posts/default/1898224272058144584'/><link rel='alternate' type='text/html' href='http://hansjar.blogspot.com/2009/02/ant-maven-gant-gradle.html' title='Ant, Maven, Gant &amp; Gradle'/><author><name>Jarle Hansen</name><uri>http://www.blogger.com/profile/12306986377142218956</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
