Skip to content

Development Environment

Marc Dutoo edited this page Nov 14, 2013 · 52 revisions

For complete distribution instructions, see Releasing EasySOA.

The current page gives details about how to set up your development environment.

System dependencies

In short (details below) :

  • Required : Oracle's JDK 7, Maven, node.js (provided), git, openssh (for git), ruby (for buildr, only required to distribute EasySOA)
  • Optional : vim (for conf files, or any other shell editor), wget (for HTTP tests), gcc/make/automake/autoconf/python (if you choose to build node.js)

How to get them

  • On Linux : get them using your favorite package manager
  • Windows : install Cygwin by getting it from http://www.cygwin.com/install.html and executing setup.exe, and configure it with said dependencies

git

In order to learn how to set up Git, see: http://help.github.com/set-up-git-redirect

If you don't have one, you need to generate your ssh identity.

Linux :

ssh-keygen -t dsa  

Windows (in the cygwin shell):

ssh-user-config  

And copy the generated .ssh/ files to your home, and there in ssh/ because eclipse needs it, see http://www.slideshare.net/loianeg/using-the-egit-eclipse-plugin-with-git-hub-2578587

Then copy the public key contents to your online github profiles' SSH keys, as described at https://help.github.com/articles/generating-ssh-keys .

More at http://inside.mines.edu/~gmurray/HowTo/sshNotes.html

Java

  • download Java JDK 7 from Oracle, unpack and install it
  • setup the JAVA_HOME environment variable to target it (on Linux, in ~/.bashrc or on Ubuntu & Debian using alternatives)
  • and twice in Eclipse : Preferences > default JDK, AND in Eclipse Maven : default

Or from command line only :

on Debian Wheezy do

# Oracle java 7 install (64 bits for Linux), see
# https://d.stavrovski.net/blog/installing-oracle-java7-on-debian-wheezy/
# http://blog.mbentley.net/2013/08/installing-oracle-java-7-jre-jdk-on-debian-wheezy/
wget --no-cookies \
--header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" \
"http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.tar.gz" \
-O /tmp/jdk-7-linux-x64.tar.gz --no-check-certificate
mkdir /usr/lib/jvm
tar xfz /tmp/jdk-7-linux-x64.tar.gz -C /usr/lib/jvm
# lists alternative priorities (if any ex. 1066, make sure the priority number at the end of the following commands is higher ex. 1067)
update-alternatives --display java
update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0/bin/java 2000
update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0/bin/javac 2000
update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.7.0/bin/javaws 2000
# to verify or configure alternatives
#update-alternatives --config java
# test
java -version

Detailed information on installing Java :

OBSOLETE Install JDK 6 on Ubuntu Lucid :

sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk
sudo update-alternatives --config java

node.js

Node.js 0.8.3 is already provided within EasySOA Discovery by Browsing, which needs it.

However, you can install your own node.js 0.8.3 : for Linux, for Windows, for Mac, source code

Or even compile it from source :

Linux :

  • get and build it (requires gcc, autoconf, automake, python)

do:

git clone --depth 1 https://github.com/joyent/node.git  
./configure  
make  
sudo make install  

or (preferably) get the latest release tarball from nodejs.org, unpack it and do as mentionned above:

./configure  
make  
sudo make install  
  • OR install it as packages

  • Windows: Official binaries are available from the official website

  • Linux: Packages from your distribution's repositories may be outdated. As of 29/03/2012, version 0.2.6 is known not to work with EasySOA, while 0.6.14 does and possibly 0.4.x too.

  • More at https://github.com/joyent/node/wiki/Installation

To debug node.js applications, see below in Tools how to use Chrome-based node-inspector or Eclipse-based Chrome Developer Tools.

Maven

(requires Java)

Get and install the latest Maven 3.0.x. For instance on Linux :

wget http://apache.crihan.fr/dist/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz -O /tmp/apache-maven-3.0.5-bin.tar.gz
tar xfz /tmp/apache-maven-3.0.5-bin.tar.gz -C ~/.

including setup of its environment variables : MAVEN_HOME, PATH but also MAVEN_OPTS (to increase memory, which is required ; or to setup debugging). For instance on Linux, edit your ~/.bashrc :

export MAVEN_HOME=~/dev/apache-maven-3.0.5
export PATH=$MAVEN_HOME/bin:$PATH
export MAVEN_OPTS="-XX:MaxPermSize=128m $MAVEN_OPTS"
#export MAVEN_OPTS="-Xmx512m $MAVEN_OPTS"
#export MAVEN_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8002,server=y,suspend=n"

If running it from Eclipse, configure it in Eclipse as an "external installation" of Maven.

Tested on maven 3.0.4.

buildr

(to build the release)

First of all you need to install Ruby and RubyGems.

On linux, if you have a 1.9.x Ruby version use this bash script to install Buildr. If you have an older Ruby version like the 1.8.x run:

sudo gem install buildr

On windows (using cygwin with wget, ruby) in the cygwin shell, do

wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz  
tar xfz rubygems-1.3.1.tgz ; cd rubygems*  
ruby setup.rb  
gem install buildr  

Tools

Your favorite code editor or IDE, such as :

Eclipse

Get Eclipse for Java, Classic or EE (at least check you have the XML editors) and the plugins for :

  • Maven (Maven to Eclipse, m2e): To configure it, in Window > Preferences, add under Java > Build Path > Classpath Variables a new one named M2_REPO and pointing at your maven repository (typically $HOME/.m2/reository). FAQ : for Frascati, remember to configure it to use your external Maven 2 installation.
  • EGit: great for visual comparison, BUT more complicated to use than the shell (especially with github upstreams), and not as stable (UI bugs). More at http://www.vogella.de/articles/EGit/article.html
  • SVN (to work with the development version of Frascati)
  • Node: The Chrome Developer Tools provides useful debugging features for Node (instead of debugging using node-inspector). A full setup tutorial is available on the node wiki.

To import EasySOA's projects in Eclipse after a checkout, just use "File > Import... > Existing Maven Projects" (requires m2e) and select the EasySOA root directory. Other projects may have no associated POM, and in these cases explicit import is required. The following projects are concerned (as of 28/03/2012):

  • easysoa-web
  • samples/Talend-Airport-Service/Talend-Airport-Service-Tutorial

Others

Netbeans, vim, emacs, notepad++...

Your favorite web browser, such as :

Firefox

with a few useful plugins :

fff

fff

Chrome (or other Webkit-based browsers)

allows to use node-inspector, which is a useful debugging tool for Node.js, with the same look-and-feel as Chrome's web debugging interface.

  1. Install with $ npm install -g node-inspector
  2. Start a node.js server, such as the one in easysoa-web/js, with node --debug easysoa.js
  3. Launch node-inspector node-inspector --web-port=8881 (or any other port, just be careful as the default one is Nuxeo's 8080)
  4. Browse to http://0.0.0.0:8881/debug?port=5858 with a WebKit-based browser (such as Chrome) and start debugging.

However node-inspector doesn't work with newer node.js & browser releases. If this limitation happens, switch to its repackaging in StrongLoopSuite, which has to be started this ways : node-inspector --web-port=8881.

Others

To help test services :

  • soapui
  • wget --post-data='a=b' url

Conclusion

Once done, the PATH env var should look like :

  • on windows : %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\dev\easysoa\node-0.4.7-i686-pc-cygwin\bin;C:\Program Files\Java\jdk1.6.0_14\bin;C:\dev\easysoa\apache-maven-2.2.1\bin
Clone this wiki locally