HOWTO: Setup Java SDK and Maven 3 on a Synology DS1511+

The following blog is a quick summary how to install Java & Maven on a Synology NAS DS1511+. This NAS is based on the Intel(R) Atom(TM) CPU K525  @ 1.80GHz which makes it in theory a MacAir running 64bits Linux with a bunch of disks connected.

Install has been done under DSM: 3.1

 

 

Step 1, Download the Java 6 SDK for Linux

Get the 64 bits binary of Java SE Development Kit 6 Update 27 ( Works! )

jdk-6u27-linux-x64.bin  (Linux x64 – Self Extracting Installer)

Login into the Synology and wget the SDK:

wget http://download.oracle.com/otn-pub/java/jdk/6u27-b07/jdk-6u27-linux-x64.bin -O ./jdk-6u27-linux-x64.bin

chmod 755 jdk-6u27-linux-x64.bin
./jdk-6u27-linux-x64.bin

Move the unpacked directory into the /opt directory ( I presume you already using ipkg )

mv jdk1.6.0_27/ /opt/
cd /opt/
ln -s /opt/jdk1.6.0_27/ java


Step 2. Update your /etc/profile

Add the following line to your /etc/profile

JAVA_HOME=/opt/java  
export JAVA_HOME         
PATH=/opt/java/bin:$PATH

Save the file and log out and log in and try

./java

Java should welcome you.

 

Step 3. Maven 3 Install
Get the latest version of Maven from the maven site.
Unpack it and move it into /opt/

mv apache-maven-3.0.3 /opt/
cd /usr/local/lib/ 
ln -s /opt/apache-maven-3.0.3/ apache-maven


Step 4. Update your /etc/profile
Add the following line to your /etc/profile

 

M2_HOME=/usr/local/lib/apache-maven
M2=$M2_HOME/bin
MAVEN_OPTS=”-Xms256m -Xmx512m”
export M2_HOME MAVEN_OPTS M2
PATH=$M2:$PATH

Save the file, log out and log in again and give maven a try

./mvn –version

Maven should welcome you

 

Food for Thought! Java 7 Install failed for me on DSM 3.1

I’ve tried to get the latest version workign but both the 32 and the 64 bit version wont load. If anybody got this working please leave me a note how you archived it. Many thanks in advance

Java 1.7 64bits

./java
Error: dl failure on line 875
Error: failed /volume1/homes/admin/jdk1.7.0_64/jre/lib/amd64/server/libjvm.so, because /lib64/libc.so.6: version `GLIBC_2.4not found (required by /volume1/homes/admin/jdk1.7.0_64/jre/lib/amd64/server/libjvm.so)

 

Java 1.7 32bits

./java
Error: dl failure on line 875
Error: failed /volume1/homes/admin/jdk1.7.0/jre/lib/i386/client/libjvm.so, because /volume1/homes/admin/jdk1.7.0/jre/lib/i386/client/libjvm.so: cannot handle TLS data

 

My top 5 Examples of Learning Google’s GWT + MVP + GIN + UIbinder

After a long week of studying the Google Widget Toolkit, also known as GWT I needed more specific examples on how to use The MVP + UIbinder and also using GIN with it. For those on the same quest, I’ve made a summary of the examples I’ve found on the web that have been most useful to me.

First some little summary for those really just starting out with GWT + MVP & GIN.

Model-view-presenter (MVP) architecture works best when developing GWT apps for two main reasons. First the MVP model, much like other design patterns, decouples development in a way that allows multiple developers to work simultaneously. Secondly, this model allows us to minimize our use of GWTTestCase, which relies on the presence of a browser, and, for the bulk of our code, write lightweight (and fast) JRE tests (which don’t require a browser).

The examples on the website from Google are sufficient to understand the material:

However after that we need some working examples to get our hands dirty.
The best example is in the example directory of he GWT SDK and is called HelloMVP. Since this software is constantly updated I leave it to the reader to download it from google.

The best way to explain GIN is by a quote from Anh Quan Nguyen:
“GIN Stands for GWT INjection. Guice brings automatic dependency injection to server side code, while GIN is for client side code.
GIN is built on top of Guice and uses a subset Guice’s binding language.”

We use GIN to reduce code and facilitate testing. That sounds like a good habit, but has some learning curve at the beginning that can be quite frustrating.

A great tutorial to start with is the presentation of Anh Quan Nguyen 

I found a couple of very useful examples which cover GWT + GIN + MVP + UI + EventBus
  1. One of the most straight forward example I’ve found refracted the standard HelloMVP application and transformed it into a full GIN version was written by Etienne aka The Wandering Canadian and can be found here: http://wanderingcanadian.posterous.com/hello-mvp-with-gin   
    Also check out his SVN repository for the full working example: https://github.com/etiennep/Wandering-Canadian

  2. Another example using GWT + MVP + GIN was written by Mahamad El Tanahy  http://www.bright-creations.com/blog/gwt-2-1-mvp-gin-example/ Different approach but good learning material

  3. A great example of how to use the EventBus was written by Hamlet D’Arcy which explains in great simplicity the use of the event bus GWT EventBus Basics

  4. The Guys from CANOO transformed the example of Hamlet into a working GEN version!: http://www.canoo.com/blog/2011/06/20/gwt-dependency-injection-recipes-using-gin-iii/

  5. Than finaly a great tuturial was written by XXXXX about how to integrate the RequestFactory into the GIN structure:
    http://cleancodematters.wordpress.com/2011/05/19/gwt-requestfactory_with_gin/
My challenge now is how to integrate the com.google.gwt.editor.client.Editor; 
into these frameworks. And any help is highly appreciated 🙂 .

Wessel
“Success is not the key to happiness. Happiness is the key to success. If you love what you are doing, you will be successful”